home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume10 / pcmail2 / part01 next >
Encoding:
Text File  |  1990-01-24  |  69.8 KB  |  2,561 lines

  1. Newsgroups: comp.sources.misc
  2. organization: Eindhoven University of Technology, The Netherlands
  3. subject: v10i033: PC-MAIL release 2, Part01/11
  4. from: wswietse@lso.win.tue.nl (Wietse Venema)
  5. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  6.  
  7. Posting-number: Volume 10, Issue 33
  8. Submitted-by: wswietse@lso.win.tue.nl (Wietse Venema)
  9. Archive-name: pcmail2/part01
  10.  
  11. This is the second release of the pc-mail software that original-
  12. ly appeared in comp.sources.misc, april 1988.
  13.  
  14. The pc-mail software provides a single user with  facilities  for
  15. creating,  sending  and  receiving  electronic mail messages. The
  16. programs were developed under UNIX  but  also  run  with  MS-DOS.
  17. Various  transport  mechanisms are supported: UUCP across dial-up
  18. links (both GNUUCP support as well as a dedicated UUCP driver are
  19. provided),  and  PC/NFS.  Porting  to  other OSes should be rela-
  20. tively easy.
  21.  
  22. #! /bin/sh
  23. # This is a shell archive.  Remove anything before this line, then unpack
  24. # it by saving it into a file and typing "sh file".  To overwrite existing
  25. # files, type "sh file -c".  You can also feed this as standard input via
  26. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  27. # will see the following message at the end:
  28. #        "End of archive 1 (of 11)."
  29. # Contents:  FEATURES README aux aux/README aux/detab.c aux/makefile
  30. #   daemon daemon/README daemon/dosunix.h daemon/ms_parse.h
  31. #   daemon/mtime.h daemon/percentm.c daemon/percentm.h
  32. #   daemon/sysexits.h daemon/syslog.h daemon/util.h main main/Beware
  33. #   main/README main/ascf.h main/clmap.h main/comm.c main/deskutil.h
  34. #   main/hsearch.h main/kbdinp.h main/logs.h main/mail.h
  35. #   main/ms_parse.h main/msd_dir.h main/myalloc.c main/ndir.c
  36. #   main/ndir.h main/screen.c main/snapshot.h main/status.h
  37. #   main/submit.c main/sysdep.h main/textcopy.c main/work.h termcap
  38. #   termcap/README termcap/buildall.bat termcap/makefile.msc
  39. #   termcap/termcap.h termcap/tgetent.c termcap/tgetflag.c
  40. #   termcap/tgetnum.c termcap/tgetstr.c termcap/tgoto.c
  41. #   termcap/tputs.c
  42. # Wrapped by wswietse@tuewsa on Mon Jan 22 17:27:12 1990
  43. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  44. if test -f FEATURES -a "${1}" != "-c" ; then 
  45.   echo shar: Will not over-write existing file \"FEATURES\"
  46. else
  47. echo shar: Extracting \"FEATURES\" \(1075 characters\)
  48. sed "s/^X//" >FEATURES <<'END_OF_FEATURES'
  49. X@(#) FEATURES 2.1 90/01/22 13:52:19
  50. X
  51. XThe following is a summary of features available with the  second
  52. Xpc-mail  release.   Features not available in the initial release
  53. Xare tagged with (new).
  54. X
  55. X- (new) A user tutorial.
  56. X
  57. X- Messages can be composed with any word processing package  that
  58. Xproduces clean ASCII textfiles.
  59. X
  60. X- Alias data base to map human-readable names to  ugly  mail  ad-
  61. Xdresses.
  62. X
  63. X- (new) Customized header lines and signatures.
  64. X
  65. X- (new) Selective suppression of ugly header lines.
  66. X
  67. X- (new) Subject: lines are shown in the message-selection menus.
  68. X
  69. X- (new) A reply command that extracts the sender's  address  from
  70. Xthe  message  being  replied to. The text of the original message
  71. Xcan be included in the reply.
  72. X
  73. X- (new) Piping of messages through a command; this is useful  for
  74. Xmessages that contain encoded files.
  75. X
  76. X- (new) Support for message transport  through  daemon  processes
  77. Xthat  run  on  a  file server. Tested with System-V Release 2 and
  78. XSunOS 4.0.3
  79. X
  80. X- (new) Hooks for message transport via GNUUCP. This software has
  81. Xundergone little testing, though.
  82. X
  83. END_OF_FEATURES
  84. if test 1075 -ne `wc -c <FEATURES`; then
  85.     echo shar: \"FEATURES\" unpacked with wrong size!
  86. fi
  87. # end of overwriting check
  88. fi
  89. if test -f README -a "${1}" != "-c" ; then 
  90.   echo shar: Will not over-write existing file \"README\"
  91. else
  92. echo shar: Extracting \"README\" \(3918 characters\)
  93. sed "s/^X//" >README <<'END_OF_README'
  94. X@(#) README 2.1 90/01/22 13:26:22
  95. X
  96. XThis is the second release of the pc-mail software that original-
  97. Xly appeared in comp.sources.misc, april 1988.
  98. X
  99. XThe pc-mail software provides a single user with  facilities  for
  100. Xcreating,  sending  and  receiving  electronic mail messages. The
  101. Xprograms were developed under UNIX  but  also  run  with  MS-DOS.
  102. XVarious  transport  mechanisms are supported: UUCP across dial-up
  103. Xlinks (both GNUUCP support as well as a dedicated UUCP driver are
  104. Xprovided),  and  PC/NFS.  Porting  to  other OSes should be rela-
  105. Xtively easy.
  106. X
  107. XIn principle, the software can be operated  in  four  ways,  that
  108. Xdiffer in the location of the user's mail data base, and  in  the
  109. Xmechanism used for message transport:
  110. X
  111. X - The mail data base is local to the pc. The user does  all  her
  112. Xwork  on  the pc. Messages are exchanged with a UNIX host via the
  113. XUUCP file-transfer program provided with the pc-mail software.
  114. X
  115. X - Ditto, but GNUUCP is used for message transport  and  routing.
  116. XThe  pc-mail source distribution provides programs that interface
  117. Xbetween pc-mail and GNUUCP.
  118. X
  119. X - The mail data base is located on a UNIX file server. The  user
  120. Xdoes all her work on the pc. Daemon programs, running on the UNIX
  121. Xfile server, take care of the actual delivery  of  messages.  The
  122. Xdaemon  programs  are part of the pc-mail source distribution and
  123. Xinterface with the sendmail program.
  124. X
  125. X - The mail data base is located on a UNIX host;  the  user  does
  126. Xall  her  work on the UNIX host; daemon programs, also running on
  127. Xthe UNIX host, take care of the actual message delivery. Although
  128. Xa bit bizarre, this mode is very useful for software development.
  129. X
  130. XThe programs support the sending and receiving of electronic mail
  131. Xonly;  no  transfer  of  files by name and no message routing. In
  132. Xfact, the pc side treats  each  incoming  data  file  as  a  mail
  133. Xmessage,  irrespective  of its actual destination. The reason for
  134. Xthese limitations are (besides uucp security problems)  that  all
  135. Xfiles  can be sent as mail, and that a pc does not provide multi-
  136. Xuser support anyway.
  137. X
  138. XFor the non-technical user there is a menu-driven shell that  au-
  139. Xtomatically  invokes  various utility programs, e.g. an editor of
  140. Xthe user's choice for editing or  creating  messages,  a  program
  141. Xthat logs in on a UNIX host to exchange files and so on. Any edi-
  142. Xtor that produces clean ASCII files can be used  (wordstar  files
  143. Xare  also  handled correctly). Other facilities: alias data base,
  144. Xbatch-mode operation, a reply command, selective  suppression  of
  145. Xmail header lines, and message templates.
  146. X
  147. XMore technically oriented users will want to avoid  the  interac-
  148. Xtive  shell  and  use  the  mail  data  base and utility programs
  149. Xdirectly. The necessary information can be found in the implemen-
  150. Xtation documentation. In addition, almost every source file has a
  151. Xbuilt-in  manual  page.  The  latter  can  be  extracted with the
  152. Xsrctoman.sh shell script which uses the detab.c program; both are
  153. Xprovided with the pc-mail source distribution.
  154. X
  155. XThe programs have been tested with various MS-DOS versions on  XT
  156. Xand  AT  clones  (using  the  MicroSoft  V4.0  C  compiler), with
  157. XMicroport System-V/AT, and with PC/NFS version  3.0.  The  daemon
  158. Xprograms were tested under Microport System-V/AT and SunOS 4.0.3.
  159. X
  160. XIn order to run the software under UNIX one needs a library  with
  161. Xthe  System-V library functions (strtok(), memcpy() et al.).  The
  162. Xsource provides BSD-compatible  libraries  for  directory  access
  163. Xwithin the System-V and MS-DOS environments.
  164. X
  165. XFor the interactive shell,  a  tiny  MS-DOS  termcap  library  is
  166. Xprovided.  It requires the ANSI.SYS driver or better. 
  167. X
  168. XYou can do anything with the source, but not ask  money  for  it,
  169. Xnor  remove  references  to  the  original  authors.  Complaints,
  170. Xfeedback and suggestions are welcome. Flames to /dev/null.
  171. X
  172. X    Wietse Venema    domain:    wswietse@lso.win.tue.nl
  173. X            bitnet:    wswietse@heitue5
  174. END_OF_README
  175. if test 3918 -ne `wc -c <README`; then
  176.     echo shar: \"README\" unpacked with wrong size!
  177. fi
  178. # end of overwriting check
  179. fi
  180. if test ! -d aux ; then
  181.     echo shar: Creating directory \"aux\"
  182.     mkdir aux
  183. fi
  184. if test -f aux/README -a "${1}" != "-c" ; then 
  185.   echo shar: Will not over-write existing file \"aux/README\"
  186. else
  187. echo shar: Extracting \"aux/README\" \(406 characters\)
  188. sed "s/^X//" >aux/README <<'END_OF_aux/README'
  189. X@(#) README 2.1 90/01/22 12:46:06
  190. X
  191. XThis directory contains utilities to extract manual pages from
  192. Xthe pc-mail source files.
  193. X
  194. Xsrctoman.sh    A Bourne-shell script to extract documentation from source 
  195. X        files. The output is suitable for formatting with the UNIX 
  196. X        man macro library
  197. X
  198. Xdetab.c        expands tabs by blanks. This program is used by the
  199. X        srctoman.sh shell script.
  200. X
  201. Xusage:
  202. X
  203. X    srctoman file | nroff -man
  204. END_OF_aux/README
  205. if test 406 -ne `wc -c <aux/README`; then
  206.     echo shar: \"aux/README\" unpacked with wrong size!
  207. fi
  208. # end of overwriting check
  209. fi
  210. if test -f aux/detab.c -a "${1}" != "-c" ; then 
  211.   echo shar: Will not over-write existing file \"aux/detab.c\"
  212. else
  213. echo shar: Extracting \"aux/detab.c\" \(1170 characters\)
  214. sed "s/^X//" >aux/detab.c <<'END_OF_aux/detab.c'
  215. X/*++
  216. X/* NAME
  217. X/*    detab 1
  218. X/* SUMMARY
  219. X/*    expand tabs to blanks
  220. X/* PROJECT
  221. X/*    sdetools
  222. X/* SYNOPSIS
  223. X/*    detab
  224. X/* DESCRIPTION
  225. X/*    Detab is a filter that expands tab stops in its standard input
  226. X/*    to blanks. A tab stop distance of eight blanks is assumed.
  227. X/* BUGS
  228. X/*    This program does not handle backspaces.
  229. X/*
  230. X/*    Should be a standard utility, but different versions of UNIX
  231. X/*    disagree on names or options.
  232. X/* AUTHOR(S)
  233. X/*    Wietse Venema
  234. X/*    Eindhoven University of Technology
  235. X/*    Department of Mathematics and Computer Science
  236. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  237. X/* CREATION DATE
  238. X/*    Sep 14 1985
  239. X/* LAST MODIFICATION
  240. X/*    10/18/89 21:52:21
  241. X/* VERSION/RELEASE
  242. X/*    1.4
  243. X/*--*/
  244. X
  245. X#include <stdio.h>
  246. X
  247. Xstatic char sccsid[] = "@(#) detab.c 1.4 10/18/89 21:52:21";
  248. X
  249. Xmain()
  250. X{
  251. X    register int c;        /* character buffer */
  252. X    register int ccount = 0;    /* nr of characters printed on current line */
  253. X
  254. X    while ((c = getchar()) != EOF) {
  255. X    switch (c) {
  256. X        case '\r':
  257. X        case '\n':  putchar(c);
  258. X            ccount = 0;
  259. X            break;
  260. X        case '\t':  do { putchar(' '); } while (++ccount & 7);
  261. X            break;
  262. X        default:    putchar(c);
  263. X            ccount++;
  264. X            break;
  265. X    }
  266. X    }
  267. X    exit(0);
  268. X}
  269. END_OF_aux/detab.c
  270. if test 1170 -ne `wc -c <aux/detab.c`; then
  271.     echo shar: \"aux/detab.c\" unpacked with wrong size!
  272. fi
  273. # end of overwriting check
  274. fi
  275. if test -f aux/makefile -a "${1}" != "-c" ; then 
  276.   echo shar: Will not over-write existing file \"aux/makefile\"
  277. else
  278. echo shar: Extracting \"aux/makefile\" \(167 characters\)
  279. sed "s/^X//" >aux/makefile <<'END_OF_aux/makefile'
  280. X# @(#) makefile 2.1 90/01/22 14:06:29
  281. X
  282. XFILES    = README detab.c makefile srctoman.sh
  283. X
  284. Xall:    srctoman detab
  285. X
  286. Xshar:    $(FILES)
  287. X    shar $(FILES)
  288. X
  289. Xarchive:
  290. X    $(ARCHIVE) $(FILES)
  291. X
  292. END_OF_aux/makefile
  293. if test 167 -ne `wc -c <aux/makefile`; then
  294.     echo shar: \"aux/makefile\" unpacked with wrong size!
  295. fi
  296. # end of overwriting check
  297. fi
  298. if test ! -d daemon ; then
  299.     echo shar: Creating directory \"daemon\"
  300.     mkdir daemon
  301. fi
  302. if test -f daemon/README -a "${1}" != "-c" ; then 
  303.   echo shar: Will not over-write existing file \"daemon/README\"
  304. else
  305. echo shar: Extracting \"daemon/README\" \(221 characters\)
  306. sed "s/^X//" >daemon/README <<'END_OF_daemon/README'
  307. X@(#) README 1.8 12/29/89 18:12:55
  308. X
  309. XThis directory contains the daemon programs that run on a file server
  310. Xthat exports per-user pc-mail directories. The documentation assumes
  311. Xthat the UNIX hosts runs the sendmail program.
  312. END_OF_daemon/README
  313. if test 221 -ne `wc -c <daemon/README`; then
  314.     echo shar: \"daemon/README\" unpacked with wrong size!
  315. fi
  316. # end of overwriting check
  317. fi
  318. if test -f daemon/dosunix.h -a "${1}" != "-c" ; then 
  319.   echo shar: Will not over-write existing file \"daemon/dosunix.h\"
  320. else
  321. echo shar: Extracting \"daemon/dosunix.h\" \(779 characters\)
  322. sed "s/^X//" >daemon/dosunix.h <<'END_OF_daemon/dosunix.h'
  323. X/*++
  324. X/* NAME
  325. X/*    dosunix 5
  326. X/* SUMMARY
  327. X/*    UNIX <-> MS-DOS text format conversion
  328. X/* PROJECT
  329. X/*    pc-mail
  330. X/* PACKAGE
  331. X/*    nfs
  332. X/* SYNOPSIS
  333. X/*    #include <stdio.h>
  334. X/*    #include "dosunix.h"
  335. X/* DESCRIPTION
  336. X/* .nf
  337. X
  338. X /* Anticipate ANSI-compatible compilers */
  339. X
  340. X#ifdef __STDC__
  341. Xint     unix2dos(FILE * ifp, FILE * ofp);
  342. Xint     dos2unix(FILE * dfp, FILE * pfp);
  343. Xchar   *dosgets(char *buf, int len, FILE * fp);
  344. X
  345. X#else
  346. Xint     unix2dos();
  347. Xint     dos2unix();
  348. Xchar   *dosgets();
  349. X
  350. X#endif
  351. X/* AUTHOR(S)
  352. X/*    Wietse Z. Venema
  353. X/*    Eindhoven University of Technology
  354. X/*    Department of Mathematics and Computer Science
  355. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  356. X/* CREATION DATE
  357. X/*    Sun Oct 29 16:41:50 MET 1989
  358. X/* LAST MODIFICATION
  359. X/*    10/29/89 22:30:05
  360. X/* VERSION/RELEASE
  361. X/*    1.1
  362. X/*--*/
  363. X
  364. END_OF_daemon/dosunix.h
  365. if test 779 -ne `wc -c <daemon/dosunix.h`; then
  366.     echo shar: \"daemon/dosunix.h\" unpacked with wrong size!
  367. fi
  368. # end of overwriting check
  369. fi
  370. if test -f daemon/ms_parse.h -a "${1}" != "-c" ; then 
  371.   echo shar: Will not over-write existing file \"daemon/ms_parse.h\"
  372. else
  373. echo shar: Extracting \"daemon/ms_parse.h\" \(888 characters\)
  374. sed "s/^X//" >daemon/ms_parse.h <<'END_OF_daemon/ms_parse.h'
  375. X/*++
  376. X/* NAME
  377. X/*      ms_parse 5
  378. X/* SUMMARY
  379. X/*      message parser
  380. X/* PROJECT
  381. X/*      pc-mail
  382. X/* PACKAGE
  383. X/*    nfs
  384. X/* SYNOPSIS
  385. X/*    #include "ms_parse.h"
  386. X/* DESCRIPTION
  387. X/* .nf
  388. X
  389. X /* status codes returned by ms_parse() */
  390. X
  391. X#define MS_UUCP        0        /* UUCP-style From_ line */
  392. X#define MS_HEADER    1        /* RFC822-like header line */
  393. X#define MS_CONT        2        /* Continued header line */
  394. X#define MS_BODY        3        /* Line within message body */
  395. X
  396. X /* entry points of the ms_parse module */
  397. X
  398. Xextern int hscanf();            /* extract info from header line */
  399. Xextern int ms_parse();            /* parse one line */
  400. X
  401. X/* AUTHOR(S)
  402. X/*      W.Z. Venema
  403. X/*      Eindhoven University of Technology
  404. X/*      Department of Mathematics and Computer Science
  405. X/*      Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  406. X/* CREATION DATE
  407. X/*    Sat Dec  9 18:50:35 MET 1989
  408. X/* LAST MODIFICATION
  409. X/*    1/6/90 19:45:22
  410. X/* VERSION/RELEASE
  411. X/*    1.6
  412. X/*--*/
  413. END_OF_daemon/ms_parse.h
  414. if test 888 -ne `wc -c <daemon/ms_parse.h`; then
  415.     echo shar: \"daemon/ms_parse.h\" unpacked with wrong size!
  416. fi
  417. # end of overwriting check
  418. fi
  419. if test -f daemon/mtime.h -a "${1}" != "-c" ; then 
  420.   echo shar: Will not over-write existing file \"daemon/mtime.h\"
  421. else
  422. echo shar: Extracting \"daemon/mtime.h\" \(943 characters\)
  423. sed "s/^X//" >daemon/mtime.h <<'END_OF_daemon/mtime.h'
  424. X/*++
  425. X/* NAME
  426. X/*    mtime 5
  427. X/* SUMMARY
  428. X/*    maintain modification times of files
  429. X/* PROJECT
  430. X/*    pc-mail
  431. X/* PACKAGE
  432. X/*    nfs
  433. X/* SYNOPSIS
  434. X/*    #include "mtime.h"
  435. X/* DESCRIPTION
  436. X/* .nf
  437. X
  438. X /* structure of one symbol-table entry */
  439. X
  440. Xtypedef struct MTIME {
  441. X    char   *path;            /* key */
  442. X    long    time;            /* value */
  443. X    struct MTIME *left;            /* left subtree */
  444. X    struct MTIME *rite;            /* right subtree */
  445. X}       MTIME;
  446. X
  447. X /* client interface */
  448. X
  449. X#define mtime(path)    (mtime_tree = findtime(path,mtime_tree))
  450. X
  451. X /* actual interface */
  452. X
  453. Xextern MTIME *mtime_tree;        /* head of symbol table */
  454. XMTIME  *findtime();            /* actual access function */
  455. X
  456. X/* AUTHOR(S)
  457. X/*    Wietse Z. Venema
  458. X/*    Eindhoven University of Technology
  459. X/*    Department of Mathematics and Computer Science
  460. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  461. X/* CREATION DATE
  462. X/*    Sun Oct 29 15:48:01 MET 1989
  463. X/* LAST MODIFICATION DATE
  464. X/*    10/29/89 22:29:58
  465. X/* VERSION/RELEASE
  466. X/*    1.1
  467. X/*--*/
  468. X
  469. END_OF_daemon/mtime.h
  470. if test 943 -ne `wc -c <daemon/mtime.h`; then
  471.     echo shar: \"daemon/mtime.h\" unpacked with wrong size!
  472. fi
  473. # end of overwriting check
  474. fi
  475. if test -f daemon/percentm.c -a "${1}" != "-c" ; then 
  476.   echo shar: Will not over-write existing file \"daemon/percentm.c\"
  477. else
  478. echo shar: Extracting \"daemon/percentm.c\" \(1708 characters\)
  479. sed "s/^X//" >daemon/percentm.c <<'END_OF_daemon/percentm.c'
  480. X/*++
  481. X/* NAME
  482. X/*    percentm 3
  483. X/* SUMMARY
  484. X/*    convert %m to system error message
  485. X/* PROJECT
  486. X/*    pc-mail
  487. X/* PACKAGE
  488. X/*    nfs
  489. X/* SYNOPSIS
  490. X/*    #include percentm.h
  491. X/*
  492. X/*    char *percentm(string, err)
  493. X/*    char *string;
  494. X/*    int err;
  495. X/* DESCRIPTION
  496. X/*    percentm() interprets %m format specificiers in \fIstring\fR
  497. X/*    In the output, %m will be replaced by the error message that
  498. X/*    corresponds with the error value \fIerr\fR (see <errno.h>.
  499. X/* BUGS
  500. X/*    The result is stored in static memory that is overwritten with
  501. X/*    each call.
  502. X/* AUTHOR(S)
  503. X/*    Wietse Z. Venema
  504. X/*    Eindhoven University of Technology
  505. X/*    Department of Mathematics and Computer Science
  506. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  507. X/* CREATION DATE
  508. X/*    Sun Oct 29 15:29:37 MET 1989
  509. X/* LAST MODIFICATION
  510. X/*    12/5/89 22:03:27
  511. X/* VERSION/RELEASE
  512. X/*    1.2
  513. X/*--*/
  514. X
  515. X#ifndef lint
  516. Xstatic char sccsid[] = "@(#) percentm.c 1.2 12/5/89 22:03:27";
  517. X
  518. X#endif
  519. X
  520. X#include <stdio.h>
  521. X#include "percentm.h"
  522. X
  523. Xextern int errno;
  524. Xextern char *sys_errlist[];
  525. Xextern int sys_nerr;
  526. Xextern char *strcpy();
  527. X
  528. X/* percentm - replace %m by error message associated with value in err */
  529. X
  530. Xchar   *percentm(str, err)
  531. Xchar   *str;
  532. Xint     err;
  533. X{
  534. X    static char buf[BUFSIZ];
  535. X    register char *ip = str;
  536. X    register char *op = buf;
  537. X
  538. X    while (*ip) {
  539. X    switch (*ip) {
  540. X    case '%':
  541. X        switch (ip[1]) {
  542. X        case '\0':                /* don't fall off end */
  543. X        *op++ = *ip++;
  544. X        break;
  545. X        case 'm':                /* replace %m */
  546. X        (void) strcpy(op,
  547. X            sys_errlist[(err < sys_nerr && err > 0) ? err : 0]);
  548. X        op += strlen(op);
  549. X        ip += 2;
  550. X        break;
  551. X        default:                /* leave %<any> alone */
  552. X        *op++ = *ip++, *op++ = *ip++;
  553. X        break;
  554. X        }
  555. X    default:
  556. X        *op++ = *ip++;
  557. X    }
  558. X    }
  559. X    *op = '\0';
  560. X    return (buf);
  561. X}
  562. X
  563. END_OF_daemon/percentm.c
  564. if test 1708 -ne `wc -c <daemon/percentm.c`; then
  565.     echo shar: \"daemon/percentm.c\" unpacked with wrong size!
  566. fi
  567. # end of overwriting check
  568. fi
  569. if test -f daemon/percentm.h -a "${1}" != "-c" ; then 
  570.   echo shar: Will not over-write existing file \"daemon/percentm.h\"
  571. else
  572. echo shar: Extracting \"daemon/percentm.h\" \(562 characters\)
  573. sed "s/^X//" >daemon/percentm.h <<'END_OF_daemon/percentm.h'
  574. X/*++
  575. X/* NAME
  576. X/*    percentm 5
  577. X/* SUMMARY
  578. X/*    convert %m to system error message
  579. X/* PROJECT
  580. X/*    pc-mail
  581. X/* PACKAGE
  582. X/*    nfs
  583. X/* SYNOPSIS
  584. X/*    #include percentm.h
  585. X/* DESCRIPTION
  586. X/* .nf
  587. X
  588. X /* external interface of the percentm module */
  589. X
  590. Xextern char *percentm();
  591. X
  592. X/* AUTHOR(S)
  593. X/*    Wietse Z. Venema
  594. X/*    Eindhoven University of Technology
  595. X/*    Department of Mathematics and Computer Science
  596. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  597. X/* CREATION DATE
  598. X/*    Sun Oct 29 15:29:37 MET 1989
  599. X/* LAST MODIFICATION
  600. X/*    10/29/89 22:31:53
  601. X/* VERSION/RELEASE
  602. X/*    1.1
  603. X/*--*/
  604. X
  605. END_OF_daemon/percentm.h
  606. if test 562 -ne `wc -c <daemon/percentm.h`; then
  607.     echo shar: \"daemon/percentm.h\" unpacked with wrong size!
  608. fi
  609. # end of overwriting check
  610. fi
  611. if test -f daemon/sysexits.h -a "${1}" != "-c" ; then 
  612.   echo shar: Will not over-write existing file \"daemon/sysexits.h\"
  613. else
  614. echo shar: Extracting \"daemon/sysexits.h\" \(972 characters\)
  615. sed "s/^X//" >daemon/sysexits.h <<'END_OF_daemon/sysexits.h'
  616. X/*++
  617. X/* NAME
  618. X/*    sysexits 5
  619. X/* SUMMARY
  620. X/*    exit status codes for programs called by sendmail
  621. X/* PROJECT
  622. X/*    pc-mail
  623. X/* PACKAGE
  624. X/*    nfs
  625. X/* SYNOPSIS
  626. X/*    #include "sysexits.h"
  627. X/* DESCRIPTION
  628. X/* .nf
  629. X
  630. X /* sendmail-compatible exit status codes */
  631. X
  632. X#define    EX_OK        0
  633. X#define EX_USAGE    64
  634. X#define EX_DATAERR    65
  635. X#define EX_NOINPUT    66
  636. X#define EX_NOUSER    67
  637. X#define EX_NOHOST    68
  638. X#define EX_UNAVAILABLE    69
  639. X#define EX_SOFTWARE    70
  640. X#define EX_OSERR    71
  641. X#define EX_OSFILE    72
  642. X#define EX_CANTCREAT    73
  643. X#define EX_IOERR    74
  644. X#define EX_TEMPFAIL    75
  645. X#define EX_PROTOCOL    76
  646. X#define EX_NOPERM    77
  647. X/* AUTHOR(S)
  648. X/*    Wietse Z. Venema
  649. X/*    Eindhoven University of Technology
  650. X/*    Department of Mathematics and Computer Science
  651. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  652. X/*
  653. X/*    These codes were actually defined by Eric Allman, the originator
  654. X/*    of the sendmail program.
  655. X/* CREATION DATE
  656. X/*    Sun Oct 29 16:03:19 MET 1989
  657. X/* LAST MODIFICATION
  658. X/*    10/29/89 22:29:47
  659. X/* VERSION/RELEASE
  660. X/*    1.1
  661. X/*--*/
  662. X
  663. END_OF_daemon/sysexits.h
  664. if test 972 -ne `wc -c <daemon/sysexits.h`; then
  665.     echo shar: \"daemon/sysexits.h\" unpacked with wrong size!
  666. fi
  667. # end of overwriting check
  668. fi
  669. if test -f daemon/syslog.h -a "${1}" != "-c" ; then 
  670.   echo shar: Will not over-write existing file \"daemon/syslog.h\"
  671. else
  672. echo shar: Extracting \"daemon/syslog.h\" \(698 characters\)
  673. sed "s/^X//" >daemon/syslog.h <<'END_OF_daemon/syslog.h'
  674. X/*++
  675. X/* NAME
  676. X/*    syslog 5
  677. X/* SUMMARY
  678. X/*    surrogate BSD4.3 syslog facility
  679. X/* PROJECT
  680. X/*    pc-mail
  681. X/* PACKAGE
  682. X/*    nfs
  683. X/* SYNOPSIS
  684. X/*    include "syslog.h"
  685. X/* DESCRIPTION
  686. X/* .nf
  687. X
  688. X /* Do nothing if we already have <syslog.h> */
  689. X
  690. X#ifndef SYSLOG
  691. X
  692. X /* various constants */
  693. X
  694. X#define    LOG_PID        1
  695. X#define    LOG_MAIL    1
  696. X#define    LOG_WARNING    1
  697. X
  698. Xextern  openlog();
  699. Xextern  syslog();
  700. Xextern  closelog();
  701. X
  702. X#endif
  703. X/* AUTHOR(S)
  704. X/*    Wietse Z. Venema
  705. X/*    Eindhoven University of Technology
  706. X/*    Department of Mathematics and Computer Science
  707. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  708. X/* CREATION DATE
  709. X/*    Sun Oct 29 15:12:57 MET 1989
  710. X/* LAST MODIFICATION
  711. X/*    10/29/89 22:29:50
  712. X/* VERSION/RELEASE
  713. X/*    1.1
  714. X/*--*/
  715. X
  716. END_OF_daemon/syslog.h
  717. if test 698 -ne `wc -c <daemon/syslog.h`; then
  718.     echo shar: \"daemon/syslog.h\" unpacked with wrong size!
  719. fi
  720. # end of overwriting check
  721. fi
  722. if test -f daemon/util.h -a "${1}" != "-c" ; then 
  723.   echo shar: Will not over-write existing file \"daemon/util.h\"
  724. else
  725. echo shar: Extracting \"daemon/util.h\" \(1060 characters\)
  726. sed "s/^X//" >daemon/util.h <<'END_OF_daemon/util.h'
  727. X/*++
  728. X/* NAME
  729. X/*    util 3
  730. X/* SUMMARY
  731. X/*    wrappers around standard library functions
  732. X/* PROJECT
  733. X/*    pc-mail
  734. X/* PACKAGE
  735. X/*    nfs
  736. X/* SYNOPSIS
  737. X/*    #include <stdio.h>
  738. X/*    #include <pwd.h>
  739. X/*    #include "util.h"
  740. X/* DESCRIPTION
  741. X/* .nf
  742. X
  743. X /* Anticipate on ANSI-compatible compilers */
  744. X
  745. X#ifdef __STDC__
  746. XFILE   *u_fopen(struct passwd * user, char *file, char *mode);
  747. Xint     u_unlink(char *file);
  748. XDIR    *e_opendir(char *path);
  749. Xint     e_chdir(char *path);
  750. Xint     e_fork(void);
  751. X
  752. X#else
  753. XFILE   *u_fopen();            /* open file, log any errors */
  754. Xint     u_unlink();            /* unlink file, log any errors */
  755. XDIR    *e_opendir();            /* open directory, log any errors */
  756. Xint     e_chdir();            /* change directory, log any errors */
  757. Xint     e_fork();            /* fork, log any errors */
  758. X
  759. X#endif
  760. X/* AUTHOR(S)
  761. X/*    Wietse Z. Venema
  762. X/*    Eindhoven University of Technology
  763. X/*    Department of Mathematics and Computer Science
  764. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  765. X/* CREATION DATE
  766. X/*    Sun Oct 29 16:21:02 MET 1989
  767. X/* LAST MODIFICATION
  768. X/*    10/29/89 22:29:55
  769. X/* VERSION/RELEASE
  770. X/*    1.1
  771. X/*--*/
  772. X
  773. END_OF_daemon/util.h
  774. if test 1060 -ne `wc -c <daemon/util.h`; then
  775.     echo shar: \"daemon/util.h\" unpacked with wrong size!
  776. fi
  777. # end of overwriting check
  778. fi
  779. if test ! -d main ; then
  780.     echo shar: Creating directory \"main\"
  781.     mkdir main
  782. fi
  783. if test -f main/Beware -a "${1}" != "-c" ; then 
  784.   echo shar: Will not over-write existing file \"main/Beware\"
  785. else
  786. echo shar: Extracting \"main/Beware\" \(827 characters\)
  787. sed "s/^X//" >main/Beware <<'END_OF_main/Beware'
  788. X@(#) Beware 2.1 90/01/22 13:01:03
  789. X
  790. XMicroSoft decided to change the order of function arguments of the C
  791. Xrename() function.  Check the source against the documentation of your
  792. Xcompiler.
  793. X
  794. XIn order to handle messages larger than about 10 kbyte, the mail program
  795. Xwill have to be compiled with the large memory model.
  796. X
  797. XSince the assembly-language serial port driver assumes a small memory
  798. Xmodel, the cico program will have to be compiled with the small memory
  799. Xmodel as well.
  800. X
  801. XThe MAILDIR, EDITOR environment variables should hold absolute path
  802. Xnames.  On MS-DOS systems (floppies!) it is a good idea to include the
  803. Xdrive name as well.
  804. X
  805. XOn some MS-DOS systems the root directory has no "." and ".." entries,
  806. Xand subdirectories directly below the root directory have no ".."
  807. Xentry.  This only has consequences for the "File" command.
  808. END_OF_main/Beware
  809. if test 827 -ne `wc -c <main/Beware`; then
  810.     echo shar: \"main/Beware\" unpacked with wrong size!
  811. fi
  812. # end of overwriting check
  813. fi
  814. if test -f main/README -a "${1}" != "-c" ; then 
  815.   echo shar: Will not over-write existing file \"main/README\"
  816. else
  817. echo shar: Extracting \"main/README\" \(704 characters\)
  818. sed "s/^X//" >main/README <<'END_OF_main/README'
  819. X@(#) README 2.1 90/01/22 13:01:10
  820. X
  821. XThis directory contains sources and documentation for all software that
  822. Xmay run on a personal machine. There are three installation documents:
  823. X
  824. XDEFAULT.ins    Describes how to install pc-mail using the default UUCP
  825. X        dial-up and file-transfer software.
  826. X
  827. XSLAVE.ins    Describes how to install pc-mail in a networked environment 
  828. X        that uses PC/NFS. The file server software is provided, and 
  829. X        described, in the `daemon' subdirectory.
  830. X
  831. XGNUUCP.ins    For the enterprising hacker; describes how to install
  832. X        pc-mail for use with the GNUUCP software.
  833. X
  834. XAn tutorial is available in the file `tutorial.ms'. A formatted version
  835. Xof this document can be found in the file `tutorial.doc'.
  836. END_OF_main/README
  837. if test 704 -ne `wc -c <main/README`; then
  838.     echo shar: \"main/README\" unpacked with wrong size!
  839. fi
  840. # end of overwriting check
  841. fi
  842. if test -f main/ascf.h -a "${1}" != "-c" ; then 
  843.   echo shar: Will not over-write existing file \"main/ascf.h\"
  844. else
  845. echo shar: Extracting \"main/ascf.h\" \(1058 characters\)
  846. sed "s/^X//" >main/ascf.h <<'END_OF_main/ascf.h'
  847. X/*++
  848. X/* NAME
  849. X/*    ascf 5
  850. X/* SUMMARY
  851. X/*    stdio-like ascii filter
  852. X/* PROJECT
  853. X/*    pc-mail
  854. X/* PACKAGE
  855. X/*    ascii filtering
  856. X/* SYNOPSIS
  857. X/*    #include <stdio.h>
  858. X/*    #include "ascf.h"
  859. X/* DESCRIPTION
  860. X/* .nf
  861. X
  862. X /* An _iobuf-like structure for buffer management */
  863. X
  864. Xtypedef struct {
  865. X    char   *buf;            /* intermediate buffer */
  866. X    char   *ptr;            /* read pointer */
  867. X    int     cnt;            /* buffer size */
  868. X    char    nlf;            /* last newline kludge */
  869. X} Asc;
  870. X
  871. X#define    ascget(p) (--asc[fileno(p)].cnt>=0?*asc[fileno(p)].ptr++&0377:ascbuf(p))
  872. X#define    ascpbk(c,p) (asc[fileno(p)].cnt++, (*--asc[fileno(p)].ptr = c))
  873. X
  874. Xextern FILE *ascopen();            /* open filtered stream */
  875. Xextern Asc asc[];            /* buffers, status etc. */
  876. Xextern char *ascgets();            /* read string, strip crlf */
  877. X
  878. X/* AUTHOR(S)
  879. X/*    W.Z. Venema
  880. X/*    Eindhoven University of Technology
  881. X/*    Department of Mathematics and Computer Science
  882. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  883. X/* CREATION DATE
  884. X/*    Mon Jul  6 16:03:41 GMT+1:00 1987
  885. X/* LAST MODIFICATION
  886. X/*    90/01/22 13:01:15
  887. X/* VERSION/RELEASE
  888. X/*    2.1
  889. X/*--*/
  890. END_OF_main/ascf.h
  891. if test 1058 -ne `wc -c <main/ascf.h`; then
  892.     echo shar: \"main/ascf.h\" unpacked with wrong size!
  893. fi
  894. # end of overwriting check
  895. fi
  896. if test -f main/clmap.h -a "${1}" != "-c" ; then 
  897.   echo shar: Will not over-write existing file \"main/clmap.h\"
  898. else
  899. echo shar: Extracting \"main/clmap.h\" \(972 characters\)
  900. sed "s/^X//" >main/clmap.h <<'END_OF_main/clmap.h'
  901. X/* Map names to lower case for the MicroSoft 3.0 CL compiler/linker command */
  902. X
  903. X#define  set_tty        SET_TTY     /* find current settings, and initialize */
  904. X#define  reset_tty      RESET_TTY   /* reset to settings that set_tty() found */
  905. X#define  get_msr        GET_MSR     /* get MSR byte from port. */
  906. X#define  init_comm      INIT_COMM   /* initialize the comm port interupts, */
  907. X#define  uninit_comm    UNINIT_COMM /* remove initialization, */
  908. X#define  set_xoff       SET_XOFF    /* enable/disable XON/XOFF, */
  909. X#define  get_xoff       GET_XOFF    /* read XON/XOFF state, */
  910. X#define  rcvd_xoff      RCVD_XOFF   /* returns true if XOFF rcvd, */
  911. X#define  sent_xoff      SENT_XOFF   /* true if XOFF sent, */
  912. X#define  inp_cnt        INP_CNT     /* returns count of rcv chars, */
  913. X#define  inp_char       INP_CHAR    /* get one char from buffer, */
  914. X#define  inp_flush      INP_FLUSH   /* flush input buffer, */
  915. X#define  outp_char      OUTP_CHAR   /* output a character, */
  916. END_OF_main/clmap.h
  917. if test 972 -ne `wc -c <main/clmap.h`; then
  918.     echo shar: \"main/clmap.h\" unpacked with wrong size!
  919. fi
  920. # end of overwriting check
  921. fi
  922. if test -f main/comm.c -a "${1}" != "-c" ; then 
  923.   echo shar: Will not over-write existing file \"main/comm.c\"
  924. else
  925. echo shar: Extracting \"main/comm.c\" \(1193 characters\)
  926. sed "s/^X//" >main/comm.c <<'END_OF_main/comm.c'
  927. X/*++
  928. X/* NAME
  929. X/*    comm 3
  930. X/* SUMMARY
  931. X/*    cico communications parameters retrieval
  932. X/* PROJECT
  933. X/*    pc-mail
  934. X/* PACKAGE
  935. X/*    cico
  936. X/* SYNOPSIS
  937. X/*    #include "params.h"
  938. X/*    #include "comm.h"
  939. X/* DESCRIPTION
  940. X/*    Implementation module for communications parameters and other
  941. X/*    global stuff that has not yet found its place.
  942. X/* AUTHOR(S)
  943. X/*    W.Z. Venema
  944. X/*    Eindhoven University of Technology
  945. X/*    Department of Mathematics and Computer Science
  946. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  947. X/* CREATION DATE
  948. X/*    Sun Apr 12 13:37:12 GMT+1:00 1987
  949. X/* LAST MODIFICATION
  950. X/*    90/01/22 13:01:20
  951. X/* VERSION/RELEASE
  952. X/*    2.1
  953. X/*--*/
  954. X
  955. X#include <stdio.h>
  956. X
  957. X#include "defs.h"
  958. X#include "params.h"
  959. X#include "comm.h"
  960. X
  961. Xpublic int ttfd = -1;                /* comm. port */
  962. Xpublic Info *comm = 0;                /* comm. info */
  963. Xpublic char *password = 0;            /* uucp password */
  964. Xpublic char rmthost[BUFSIZ] = "Unknown";    /* remote host name */
  965. X
  966. Xpublic int (*Read)()  = 0;            /* protocol read function */
  967. Xpublic int (*Write)() = 0;            /* protocol write function */
  968. Xpublic int (*Close)() = 0;            /* protocol close function */
  969. X
  970. Xpublic char msgin[MSGBUF];            /* message receive buffer */
  971. Xpublic char msgout[MSGBUF];                  /* message send buffer */
  972. END_OF_main/comm.c
  973. if test 1193 -ne `wc -c <main/comm.c`; then
  974.     echo shar: \"main/comm.c\" unpacked with wrong size!
  975. fi
  976. # end of overwriting check
  977. fi
  978. if test -f main/deskutil.h -a "${1}" != "-c" ; then 
  979.   echo shar: Will not over-write existing file \"main/deskutil.h\"
  980. else
  981. echo shar: Extracting \"main/deskutil.h\" \(717 characters\)
  982. sed "s/^X//" >main/deskutil.h <<'END_OF_main/deskutil.h'
  983. X/*++
  984. X/* NAME
  985. X/*    deskutil 5
  986. X/* SUMMARY
  987. X/*    visible desk top utility funtions 
  988. X/* PROJECT
  989. X/*    pc-mail
  990. X/* PACKAGE
  991. X/*    mailsh
  992. X/* SYNOPSIS
  993. X/*    #include "deskutil.h"
  994. X/* DESCRIPTION
  995. X/* .nf
  996. X
  997. X/* /* externally visible functions in deskutil.c */
  998. X
  999. Xextern void patience();
  1000. Xextern int when();
  1001. Xextern int unspool();
  1002. Xextern int save();
  1003. Xextern int print();
  1004. Xextern int delete();
  1005. X/* SEE ALSO
  1006. X/*      desk(3);
  1007. X/* AUTHOR(S);
  1008. X/*      W.Z. Venema
  1009. X/*      Eindhoven University of Technology
  1010. X/*      Department of Mathematics and Computer Science
  1011. X/*      Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  1012. X/* CREATION DATE
  1013. X/*    Tue May 12 15:35:20 GMT+1:00 1987
  1014. X/* LAST MODIFICATION
  1015. X/*    1/22/90 13:01:33
  1016. X/* VERSION/RELEASE
  1017. X/*    2.1
  1018. X/*--*/
  1019. END_OF_main/deskutil.h
  1020. if test 717 -ne `wc -c <main/deskutil.h`; then
  1021.     echo shar: \"main/deskutil.h\" unpacked with wrong size!
  1022. fi
  1023. # end of overwriting check
  1024. fi
  1025. if test -f main/hsearch.h -a "${1}" != "-c" ; then 
  1026.   echo shar: Will not over-write existing file \"main/hsearch.h\"
  1027. else
  1028. echo shar: Extracting \"main/hsearch.h\" \(499 characters\)
  1029. sed "s/^X//" >main/hsearch.h <<'END_OF_main/hsearch.h'
  1030. X/* hsearch.c --- PD simple implementation of System V hsearch(3c) routine */
  1031. X
  1032. X /*
  1033. X  * Original author: Arnold Robbins
  1034. X  * 
  1035. X  * Changes by me (WZV):
  1036. X  * 
  1037. X  * put this part of the original hsearch.c in a separate file
  1038. X  * 
  1039. X  * make the lookup and hashing algorithms case-insensitive
  1040. X  */
  1041. X
  1042. X#include <stdio.h>
  1043. X
  1044. Xtypedef struct entry {
  1045. X    char *key;
  1046. X    char *data;
  1047. X    } ENTRY;
  1048. X
  1049. Xtypedef enum {
  1050. X    FIND,
  1051. X    ENTER
  1052. X    } ACTION;
  1053. X
  1054. Xtypedef struct element {
  1055. X    ENTRY    item;
  1056. X    struct element *next;
  1057. X    } ELEMENT;
  1058. X
  1059. XENTRY *hsearch();
  1060. END_OF_main/hsearch.h
  1061. if test 499 -ne `wc -c <main/hsearch.h`; then
  1062.     echo shar: \"main/hsearch.h\" unpacked with wrong size!
  1063. fi
  1064. # end of overwriting check
  1065. fi
  1066. if test -f main/kbdinp.h -a "${1}" != "-c" ; then 
  1067.   echo shar: Will not over-write existing file \"main/kbdinp.h\"
  1068. else
  1069. echo shar: Extracting \"main/kbdinp.h\" \(731 characters\)
  1070. sed "s/^X//" >main/kbdinp.h <<'END_OF_main/kbdinp.h'
  1071. X/*++
  1072. X/* NAME
  1073. X/*    kbdinp
  1074. X/* SUMMARY
  1075. X/*    keyboard interpreter definitions
  1076. X/* PROJECT
  1077. X/*    pc-mail
  1078. X/* PACKAGE
  1079. X/*    mail
  1080. X/* SYNOPSIS
  1081. X/*    #include "kbdinp.h"
  1082. X/* DESCRIPTION
  1083. X/* .nf
  1084. X
  1085. X /* keyboard interpreter function types */
  1086. X
  1087. Xextern int kbdinp();            /* interpreter */
  1088. Xextern void kbdinit();            /* set terminal modes */
  1089. Xextern void kbdrest();            /* restore terminal modes */
  1090. X
  1091. X/* SEE ALSO
  1092. X/*    kbdinp(3)    keyboard interpreter implementation
  1093. X/* AUTHOR(S)
  1094. X/*    W.Z. Venema
  1095. X/*    Eindhoven University of Technology
  1096. X/*    Department of Mathematics and Computer Science
  1097. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  1098. X/* CREATION DATE
  1099. X/*    Sat Apr  4 19:12:01 GMT+1:00 1987
  1100. X/* LAST MODIFICATION
  1101. X/*    90/01/22 13:01:53
  1102. X/* VERSION/RELEASE
  1103. X/*    2.1
  1104. X/*--*/
  1105. END_OF_main/kbdinp.h
  1106. if test 731 -ne `wc -c <main/kbdinp.h`; then
  1107.     echo shar: \"main/kbdinp.h\" unpacked with wrong size!
  1108. fi
  1109. # end of overwriting check
  1110. fi
  1111. if test -f main/logs.h -a "${1}" != "-c" ; then 
  1112.   echo shar: Will not over-write existing file \"main/logs.h\"
  1113. else
  1114. echo shar: Extracting \"main/logs.h\" \(851 characters\)
  1115. sed "s/^X//" >main/logs.h <<'END_OF_main/logs.h'
  1116. X/*++
  1117. X/* NAME
  1118. X/*    logs 5
  1119. X/* SUMMARY
  1120. X/*    various message services
  1121. X/* PROJECT
  1122. X/*    pc-mail
  1123. X/* PACKAGE
  1124. X/*    cico
  1125. X/* SYNOPSIS
  1126. X/*    #include "logs.h"
  1127. X/* DESCRIPTION
  1128. X/* .nf
  1129. X
  1130. X /* globally visible components */
  1131. X
  1132. X#define debug(l) (dflag >= l) && dbg    /* yuck! */
  1133. X
  1134. Xextern int dflag;            /* debugging level */
  1135. Xextern int *systrap;            /* panic button */
  1136. X
  1137. Xextern void trap();            /* exception handler */
  1138. Xextern int open_log();            /* open log file */
  1139. Xextern int dbg();            /* write debug info */
  1140. Xextern void log();            /* write logging info */
  1141. X
  1142. X/* FILES
  1143. X/*    $MAILDIR/logfile
  1144. X/* AUTHOR(S)
  1145. X/*    W.Z. Venema
  1146. X/*    Eindhoven University of Technology
  1147. X/*    Department of Mathematics and Computer Science
  1148. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  1149. X/* CREATION DATE
  1150. X/*    Sun Apr 12 13:45:11 GMT+1:00 1987
  1151. X/* LAST MODIFICATION
  1152. X/*    90/01/22 13:02:03
  1153. X/* VERSION/RELEASE
  1154. X/*    2.1
  1155. X/*--*/
  1156. END_OF_main/logs.h
  1157. if test 851 -ne `wc -c <main/logs.h`; then
  1158.     echo shar: \"main/logs.h\" unpacked with wrong size!
  1159. fi
  1160. # end of overwriting check
  1161. fi
  1162. if test -f main/mail.h -a "${1}" != "-c" ; then 
  1163.   echo shar: Will not over-write existing file \"main/mail.h\"
  1164. else
  1165. echo shar: Extracting \"main/mail.h\" \(1592 characters\)
  1166. sed "s/^X//" >main/mail.h <<'END_OF_main/mail.h'
  1167. X/*++
  1168. X/* NAME
  1169. X/*    mail 5
  1170. X/* SUMMARY
  1171. X/*    global declarations for mail shell
  1172. X/* PROJECT
  1173. X/*    pc-mail
  1174. X/* PACKAGE
  1175. X/*    mail
  1176. X/* SYNOPSIS
  1177. X/*    #include "mail.h"
  1178. X/* DESCRIPTION
  1179. X/* .nf
  1180. X
  1181. X /* Global declarations for the mail shell */
  1182. X
  1183. Xextern int alias();            /* alias.c */
  1184. Xextern int call();            /* call.c */
  1185. Xextern int create();            /* create.c */
  1186. Xextern void init();            /* desk.c */
  1187. Xextern int junk_desk();            /* desk.c */
  1188. Xextern char message[];            /* desk.c */
  1189. Xextern char comment[];            /* desk.c */
  1190. Xextern void patience();            /* deskutil.c */
  1191. Xextern int when();            /* deskutil.c */
  1192. Xextern int unspool();            /* deskutil.c */
  1193. Xextern int save();            /* deskutil.c */
  1194. Xextern int filter();            /* deskutil.c */
  1195. Xextern int print();            /* deskutil.c */
  1196. Xextern int delete();            /* deskutil.c */
  1197. Xextern char *tstamp();            /* deskutil.c */
  1198. Xextern int edit();            /* edit.c */
  1199. Xextern int work();            /* email.c */
  1200. Xextern int work_disp();            /* email.c */
  1201. Xextern int file();            /* file.c */
  1202. Xextern int junk_file();            /* file.c */
  1203. Xextern int kbdinp();            /* kbdinp.c */
  1204. Xextern void kbdinit();            /* kbdinp.c */
  1205. Xextern void kbdrest();            /* kbdinp.c */
  1206. Xextern int mailfile();            /* mailfile.c */
  1207. Xextern int makework();            /* makework.c */
  1208. Xextern int mbox();            /* mbox.c */
  1209. Xextern int reply();            /* reply.c */
  1210. Xextern int setup();            /* setup.c */
  1211. X
  1212. X/* AUTHOR(S)
  1213. X/*    W.Z. Venema
  1214. X/*    Eindhoven University of Technology
  1215. X/*    Department of Mathematics and Computer Science
  1216. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  1217. X/* CREATION DATE
  1218. X/*    Sat Apr 16 16:42:07 MET 1988
  1219. X/* LAST MODIFICATION
  1220. X/*    90/01/22 13:02:05
  1221. X/* VERSION/RELEASE
  1222. X/*    2.1
  1223. X/*--*/
  1224. END_OF_main/mail.h
  1225. if test 1592 -ne `wc -c <main/mail.h`; then
  1226.     echo shar: \"main/mail.h\" unpacked with wrong size!
  1227. fi
  1228. # end of overwriting check
  1229. fi
  1230. if test -f main/ms_parse.h -a "${1}" != "-c" ; then 
  1231.   echo shar: Will not over-write existing file \"main/ms_parse.h\"
  1232. else
  1233. echo shar: Extracting \"main/ms_parse.h\" \(898 characters\)
  1234. sed "s/^X//" >main/ms_parse.h <<'END_OF_main/ms_parse.h'
  1235. X/*++
  1236. X/* NAME
  1237. X/*      ms_parse 5
  1238. X/* SUMMARY
  1239. X/*      message parser
  1240. X/* PROJECT
  1241. X/*      pc-mail
  1242. X/* PACKAGE
  1243. X/*      mailsh
  1244. X/* SYNOPSIS
  1245. X/*    #include "ms_parse.h"
  1246. X/* DESCRIPTION
  1247. X/* .nf
  1248. X
  1249. X /* status codes returned by ms_parse() */
  1250. X
  1251. X#define MS_UUCP        0        /* UUCP-style From_ line */
  1252. X#define MS_HEADER    1        /* RFC822-like header line */
  1253. X#define MS_CONT        2        /* Continued header line */
  1254. X#define MS_BODY        3        /* Line within message body */
  1255. X
  1256. X /* entry points of the ms_parse module */
  1257. X
  1258. Xextern int hscanf();            /* extract info from header line */
  1259. Xextern int ms_parse();            /* parse one line */
  1260. X
  1261. X/* AUTHOR(S)
  1262. X/*      W.Z. Venema
  1263. X/*      Eindhoven University of Technology
  1264. X/*      Department of Mathematics and Computer Science
  1265. X/*      Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  1266. X/* CREATION DATE
  1267. X/*    Sat Dec  9 18:50:35 MET 1989
  1268. X/* LAST MODIFICATION
  1269. X/*    90/01/22 13:02:13
  1270. X/* VERSION/RELEASE
  1271. X/*    2.1
  1272. X/*--*/
  1273. END_OF_main/ms_parse.h
  1274. if test 898 -ne `wc -c <main/ms_parse.h`; then
  1275.     echo shar: \"main/ms_parse.h\" unpacked with wrong size!
  1276. fi
  1277. # end of overwriting check
  1278. fi
  1279. if test -f main/msd_dir.h -a "${1}" != "-c" ; then 
  1280.   echo shar: Will not over-write existing file \"main/msd_dir.h\"
  1281. else
  1282. echo shar: Extracting \"main/msd_dir.h\" \(954 characters\)
  1283. sed "s/^X//" >main/msd_dir.h <<'END_OF_main/msd_dir.h'
  1284. X/*
  1285. X * @(#)msd_dir.h 1.4 87/11/06    Public Domain.
  1286. X *
  1287. X *  A public domain implementation of BSD directory routines for
  1288. X *  MS-DOS.  Written by Michael Rendell ({uunet,utai}michael@garfield),
  1289. X *  August 1897
  1290. X */
  1291. X
  1292. X#define    rewinddir(dirp)    seekdir(dirp, 0L)
  1293. X
  1294. X#define    MAXNAMLEN    12
  1295. X
  1296. Xstruct direct {
  1297. X    ino_t    d_ino;            /* a bit of a farce */
  1298. X    int    d_reclen;        /* more farce */
  1299. X    int    d_namlen;        /* length of d_name */
  1300. X    char    d_name[MAXNAMLEN + 1];        /* garentee null termination */
  1301. X};
  1302. X
  1303. Xstruct _dircontents {
  1304. X    char    *_d_entry;
  1305. X    struct _dircontents    *_d_next;
  1306. X};
  1307. X
  1308. Xtypedef struct _dirdesc {
  1309. X    int        dd_id;    /* uniquely identify each open directory */
  1310. X    long        dd_loc;    /* where we are in directory entry is this */
  1311. X    struct _dircontents    *dd_contents;    /* pointer to contents of dir */
  1312. X    struct _dircontents    *dd_cp;    /* pointer to current position */
  1313. X} DIR;
  1314. X
  1315. Xextern    DIR        *opendir();
  1316. Xextern    struct direct    *readdir();
  1317. Xextern    void        seekdir();
  1318. Xextern    long        telldir();
  1319. Xextern    void        closedir();
  1320. END_OF_main/msd_dir.h
  1321. if test 954 -ne `wc -c <main/msd_dir.h`; then
  1322.     echo shar: \"main/msd_dir.h\" unpacked with wrong size!
  1323. fi
  1324. # end of overwriting check
  1325. fi
  1326. if test -f main/myalloc.c -a "${1}" != "-c" ; then 
  1327.   echo shar: Will not over-write existing file \"main/myalloc.c\"
  1328. else
  1329. echo shar: Extracting \"main/myalloc.c\" \(999 characters\)
  1330. sed "s/^X//" >main/myalloc.c <<'END_OF_main/myalloc.c'
  1331. X#include <stdio.h>
  1332. X#include <varargs.h>
  1333. X
  1334. Xextern char *progname;
  1335. X
  1336. X#include "defs.h"
  1337. X
  1338. X/* fatal - another way to terminate */
  1339. X
  1340. X/* VARARGS */
  1341. X
  1342. Xpublic  fatal(va_alist) 
  1343. Xva_dcl
  1344. X{
  1345. X    va_list ap;
  1346. X    char   *fmt;
  1347. X
  1348. X    if (progname && *progname)
  1349. X    (void) fprintf(stderr, "%s: ", progname);
  1350. X    va_start(ap);
  1351. X    fmt = va_arg(ap, char *);
  1352. X    (void) vfprintf(stderr, fmt, ap);
  1353. X    va_end(ap);
  1354. X    (void) abort();
  1355. X    exit(1);
  1356. X}
  1357. X
  1358. X/* myalloc - allocate memory or terminate */
  1359. X
  1360. Xpublic char *myalloc(size)
  1361. Xunsigned size;
  1362. X{
  1363. X    register char *p;
  1364. X    char   *malloc();
  1365. X
  1366. X    if ((p = malloc(size)) == 0)
  1367. X    fatal("memory allocation error");
  1368. X    return (p);
  1369. X}
  1370. X
  1371. X/* myrealloc - extend memory or terminate (allows NULL pointer) */
  1372. X
  1373. Xpublic char *myrealloc(ptr, size)
  1374. Xchar   *ptr;
  1375. Xunsigned size;
  1376. X{
  1377. X    register char *p;
  1378. X    char   *realloc();
  1379. X
  1380. X    if (ptr == 0) {
  1381. X    return (myalloc(size));
  1382. X    } else if ((p = realloc(ptr, size)) == 0) {
  1383. X    fatal("memory allocation error");
  1384. X    /* NOTREACHED */
  1385. X    } else {
  1386. X    return (p);
  1387. X    }
  1388. X}
  1389. END_OF_main/myalloc.c
  1390. if test 999 -ne `wc -c <main/myalloc.c`; then
  1391.     echo shar: \"main/myalloc.c\" unpacked with wrong size!
  1392. fi
  1393. # end of overwriting check
  1394. fi
  1395. if test -f main/ndir.c -a "${1}" != "-c" ; then 
  1396.   echo shar: Will not over-write existing file \"main/ndir.c\"
  1397. else
  1398. echo shar: Extracting \"main/ndir.c\" \(1729 characters\)
  1399. sed "s/^X//" >main/ndir.c <<'END_OF_main/ndir.c'
  1400. X/* This source was taken from the rn program by Larry Wall */
  1401. X
  1402. X#ifdef USENDIR
  1403. X#include <sys/types.h>
  1404. X#include "ndir.h"
  1405. X
  1406. X/*
  1407. X * support for Berkeley directory reading routine on a V7 file system
  1408. X */
  1409. X
  1410. X/*
  1411. X * open a directory.
  1412. X */
  1413. XDIR *
  1414. Xopendir(name)
  1415. Xchar *name;
  1416. X{
  1417. X    register DIR *dirp;
  1418. X    register int fd;
  1419. X    char *malloc();
  1420. X
  1421. X    if ((fd = open(name, 0)) == -1)
  1422. X        return NULL;
  1423. X    if ((dirp = (DIR *)malloc(sizeof(DIR))) == NULL) {
  1424. X        close (fd);
  1425. X        return NULL;
  1426. X    }
  1427. X    dirp->dd_fd = fd;
  1428. X    dirp->dd_loc = 0;
  1429. X    return dirp;
  1430. X}
  1431. X
  1432. X/*
  1433. X * read an old style directory entry and present it as a new one
  1434. X */
  1435. X#ifndef pyr
  1436. X#define    ODIRSIZ    14
  1437. X
  1438. Xstruct    olddirect {
  1439. X    ino_t    od_ino;
  1440. X    char    od_name[ODIRSIZ];
  1441. X};
  1442. X#else    an Pyramid in the ATT universe
  1443. X#define    ODIRSIZ    248
  1444. X
  1445. Xstruct    olddirect {
  1446. X    long    od_ino;
  1447. X    short    od_fill1, od_fill2;
  1448. X    char    od_name[ODIRSIZ];
  1449. X};
  1450. X#endif
  1451. X
  1452. X/*
  1453. X * get next entry in a directory.
  1454. X */
  1455. Xstruct direct *
  1456. Xreaddir(dirp)
  1457. Xregister DIR *dirp;
  1458. X{
  1459. X    register struct olddirect *dp;
  1460. X    static struct direct dir;
  1461. X
  1462. X    for (;;) {
  1463. X        if (dirp->dd_loc == 0) {
  1464. X            dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf,
  1465. X                DIRBLKSIZ);
  1466. X            if (dirp->dd_size <= 0)
  1467. X                return NULL;
  1468. X        }
  1469. X        if (dirp->dd_loc >= dirp->dd_size) {
  1470. X            dirp->dd_loc = 0;
  1471. X            continue;
  1472. X        }
  1473. X        dp = (struct olddirect *)(dirp->dd_buf + dirp->dd_loc);
  1474. X        dirp->dd_loc += sizeof(struct olddirect);
  1475. X        if (dp->od_ino == 0)
  1476. X            continue;
  1477. X        dir.d_ino = dp->od_ino;
  1478. X        strncpy(dir.d_name, dp->od_name, ODIRSIZ);
  1479. X        dir.d_name[ODIRSIZ] = '\0'; /* insure null termination */
  1480. X        dir.d_namlen = strlen(dir.d_name);
  1481. X        dir.d_reclen = DIRSIZ(&dir);
  1482. X        return (&dir);
  1483. X    }
  1484. X}
  1485. X
  1486. X/*
  1487. X * close a directory.
  1488. X */
  1489. Xvoid
  1490. Xclosedir(dirp)
  1491. Xregister DIR *dirp;
  1492. X{
  1493. X    close(dirp->dd_fd);
  1494. X    dirp->dd_fd = -1;
  1495. X    dirp->dd_loc = 0;
  1496. X    free(dirp);
  1497. X}
  1498. X#endif USENDIR
  1499. END_OF_main/ndir.c
  1500. if test 1729 -ne `wc -c <main/ndir.c`; then
  1501.     echo shar: \"main/ndir.c\" unpacked with wrong size!
  1502. fi
  1503. # end of overwriting check
  1504. fi
  1505. if test -f main/ndir.h -a "${1}" != "-c" ; then 
  1506.   echo shar: Will not over-write existing file \"main/ndir.h\"
  1507. else
  1508. echo shar: Extracting \"main/ndir.h\" \(1386 characters\)
  1509. sed "s/^X//" >main/ndir.h <<'END_OF_main/ndir.h'
  1510. X/* This source was taken from the rn program by Larry Wall */
  1511. X
  1512. X#ifdef    MSDOS
  1513. X# include <sys/types.h>
  1514. X# include "msd_dir.h"
  1515. X#else
  1516. X# ifdef LIBNDIR
  1517. X#   include <ndir.h>
  1518. X# else
  1519. X#   ifndef USENDIR
  1520. X#    include <sys/types.h>
  1521. X#    include <sys/dir.h>
  1522. X#   else
  1523. X
  1524. X#ifndef DEV_BSIZE
  1525. X#define    DEV_BSIZE    512
  1526. X#endif
  1527. X#define DIRBLKSIZ    DEV_BSIZE
  1528. X#define    MAXNAMLEN    255
  1529. X
  1530. Xstruct    direct {
  1531. X    long    d_ino;            /* inode number of entry */
  1532. X    short    d_reclen;        /* length of this record */
  1533. X    short    d_namlen;        /* length of string in d_name */
  1534. X    char    d_name[MAXNAMLEN + 1];    /* name must be no longer than this */
  1535. X};
  1536. X
  1537. X/*
  1538. X * The DIRSIZ macro gives the minimum record length which will hold
  1539. X * the directory entry.  This requires the amount of space in struct direct
  1540. X * without the d_name field, plus enough space for the name with a terminating
  1541. X * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
  1542. X */
  1543. X#undef DIRSIZ
  1544. X#define DIRSIZ(dp) \
  1545. X    ((sizeof (struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
  1546. X
  1547. X/*
  1548. X * Definitions for library routines operating on directories.
  1549. X */
  1550. Xtypedef struct _dirdesc {
  1551. X    int    dd_fd;
  1552. X    long    dd_loc;
  1553. X    long    dd_size;
  1554. X    char    dd_buf[DIRBLKSIZ];
  1555. X} DIR;
  1556. X#ifndef NULL
  1557. X#define NULL 0
  1558. X#endif
  1559. Xextern    DIR *opendir();
  1560. Xextern    struct direct *readdir();
  1561. Xextern    long telldir();
  1562. Xextern    void seekdir();
  1563. X#define rewinddir(dirp)    seekdir((dirp), (long)0)
  1564. Xextern    void closedir();
  1565. X
  1566. X#   endif
  1567. X# endif
  1568. X#endif
  1569. END_OF_main/ndir.h
  1570. if test 1386 -ne `wc -c <main/ndir.h`; then
  1571.     echo shar: \"main/ndir.h\" unpacked with wrong size!
  1572. fi
  1573. # end of overwriting check
  1574. fi
  1575. if test -f main/screen.c -a "${1}" != "-c" ; then 
  1576.   echo shar: Will not over-write existing file \"main/screen.c\"
  1577. else
  1578. echo shar: Extracting \"main/screen.c\" \(1635 characters\)
  1579. sed "s/^X//" >main/screen.c <<'END_OF_main/screen.c'
  1580. X/*++
  1581. X/* NAME
  1582. X/*      screen 3
  1583. X/* SUMMARY
  1584. X/*      often-used message strings
  1585. X/* PROJECT
  1586. X/*      pc-mail
  1587. X/* PACKAGE
  1588. X/*      mail
  1589. X/* SYNOPSIS
  1590. X/*      #include "screen.h"
  1591. X/* DESCRIPTION
  1592. X/*      Messages and strings used in more than one Screen structure
  1593. X/*    are kept here.
  1594. X/* SEE ALSO
  1595. X/*      screen(5)       screen table structure
  1596. X/*      kbdinp(3)      screen table interpreter
  1597. X/* AUTHOR(S)
  1598. X/*      W.Z. Venema
  1599. X/*      Eindhoven University of Technology
  1600. X/*      Department of Mathematics and Computer Science
  1601. X/*      Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  1602. X/* CREATION DATE
  1603. X/*      Wed Apr  1 21:14:53 GMT+1:00 1987
  1604. X/* LAST MODIFICATION
  1605. X/*    90/01/22 13:02:34
  1606. X/* VERSION/RELEASE
  1607. X/*    2.1
  1608. X/*--*/
  1609. X
  1610. X#include "defs.h"
  1611. X#include "screen.h"
  1612. X
  1613. X/* general strings used in more than one Screen structure */
  1614. X
  1615. Xpublic char anykey[]    = "Press any key to continue";
  1616. Xpublic char initscreen[]= "Return to initial screen";
  1617. Xpublic char prevscreen[]= "Return to previous screen";
  1618. Xpublic char int_error[]    = "The program is confused";
  1619. Xpublic char pageup[]    = "Move screen one page upwards";
  1620. Xpublic char pagedn[]    = "Move screen one page downwards";
  1621. Xpublic char csrup[]    = "Move cursor upwards";
  1622. Xpublic char csrdn[]    = "Move cursor downwards";
  1623. Xpublic char getsummary[]= "Press ESC to cancel. Enter a one-line summary for identification:";
  1624. Xpublic char getaddr[]    = "Press ESC to cancel. Send message to:";
  1625. Xpublic char printcurr[]    = "Print this message";
  1626. Xpublic char delcurr[]    = "Delete this message";
  1627. X
  1628. X/* we have a problem reading a mail message */
  1629. X
  1630. Xpublic char *m_msgread[] = {
  1631. X    "",
  1632. X    "Sorry, that message is no longer available",
  1633. X    0,
  1634. X};
  1635. END_OF_main/screen.c
  1636. if test 1635 -ne `wc -c <main/screen.c`; then
  1637.     echo shar: \"main/screen.c\" unpacked with wrong size!
  1638. fi
  1639. # end of overwriting check
  1640. fi
  1641. if test -f main/snapshot.h -a "${1}" != "-c" ; then 
  1642.   echo shar: Will not over-write existing file \"main/snapshot.h\"
  1643. else
  1644. echo shar: Extracting \"main/snapshot.h\" \(841 characters\)
  1645. sed "s/^X//" >main/snapshot.h <<'END_OF_main/snapshot.h'
  1646. X/*++
  1647. X/* NAME
  1648. X/*    snapshot 5
  1649. X/* SUMMARY
  1650. X/*    keep overview of the mail directory
  1651. X/* PROJECT
  1652. X/*    pc-mail
  1653. X/* PACKAGE
  1654. X/*    mail
  1655. X/* SYNOPSIS
  1656. X/*    #include "snapshot.h"
  1657. X/* DESCRIPTION
  1658. X/* .nf
  1659. X
  1660. X /* Storage for one message entry in the snapshot table */
  1661. X
  1662. Xtypedef struct {
  1663. X    unsigned short msgno;        /* message sequence number */
  1664. X    char    prefix;            /* message name prefix */
  1665. X} SNAP_SHOT;
  1666. X
  1667. X/* access functions */
  1668. X
  1669. Xpublic void snap_junk();        /* junk snapshot table */
  1670. Xpublic SNAP_SHOT *snap_shot();        /* make sure shapshot exists */
  1671. X
  1672. X/* AUTHOR(S)
  1673. X/*      W.Z. Venema
  1674. X/*      Eindhoven University of Technology
  1675. X/*      Department of Mathematics and Computer Science
  1676. X/*      Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  1677. X/* CREATION DATE
  1678. X/*    Sun Dec 17 19:51:55 MET 1989
  1679. X/* LAST MODIFICATION
  1680. X/*    90/01/22 13:02:39
  1681. X/* VERSION/RELEASE
  1682. X/*    2.1
  1683. X/*--*/
  1684. END_OF_main/snapshot.h
  1685. if test 841 -ne `wc -c <main/snapshot.h`; then
  1686.     echo shar: \"main/snapshot.h\" unpacked with wrong size!
  1687. fi
  1688. # end of overwriting check
  1689. fi
  1690. if test -f main/status.h -a "${1}" != "-c" ; then 
  1691.   echo shar: Will not over-write existing file \"main/status.h\"
  1692. else
  1693. echo shar: Extracting \"main/status.h\" \(1700 characters\)
  1694. sed "s/^X//" >main/status.h <<'END_OF_main/status.h'
  1695. X/*++
  1696. X/* NAME
  1697. X/*    status 5
  1698. X/* SUMMARY
  1699. X/*    process termination status
  1700. X/* PROJECT
  1701. X/*    pc-mail
  1702. X/* PACKAGE
  1703. X/*    library
  1704. X/* SYNOPSIS
  1705. X/*    #include "status.h"
  1706. X/* DESCRIPTION
  1707. X/* .nf
  1708. X
  1709. X /* process termination status codes */
  1710. X
  1711. X#define    E_SUCCESS    0        /* successfull completion */
  1712. X
  1713. X#define    E_SYSFAIL    41        /* operating system failure */
  1714. X#define    E_NOPROG    42        /* program not found */
  1715. X#define    E_NOSPOOL    43        /* no spool directory */
  1716. X#define    E_READERR    44        /* data file read error */
  1717. X#define    E_WRITERR    45        /* data file write error */
  1718. X#define    E_CONFUSED    46        /* internal error */
  1719. X#define    E_UNKNOWN    47        /* unknown error */
  1720. X#define    E_FILENO    48        /* cannot open enough files */
  1721. X#define    E_BADSETUP    49        /* bad setup parameter */
  1722. X#define    E_UNLINK    50        /* cannot remove file */
  1723. X#define    E_PRINTERR    51        /* printer error */
  1724. X#define    E_NOUSER    52        /* unknown user */
  1725. X#define    E_OVALIAS    53        /* alias expansion overflow */
  1726. X#define    E_TOOLONG    54        /* list of recipients too long */
  1727. X
  1728. X /* cico specific codes */
  1729. X
  1730. X#define    E_NOLINE    61        /* cannot reach host */
  1731. X#define    E_NORESP    62        /* no ititial response */
  1732. X#define    E_REJECT    63        /* rejected by host (unknown,... ) */
  1733. X#define    E_LOST        64        /* link lost (timeout,...) */
  1734. X/* SEE ALSO
  1735. X/*    status(3)    error message implementation
  1736. X/* BUGS
  1737. X/*    The usual error message problem: there is hardly any context
  1738. X/*    information. A read error is a read error, no info about the
  1739. X/*    state of processing when it ocurred.
  1740. X/* AUTHOR(S)
  1741. X/*    W.Z. Venema
  1742. X/*    Eindhoven University of Technology
  1743. X/*    Department of Mathematics and Computer Science
  1744. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  1745. X/* CREATION DATE
  1746. X/*    Sat Apr 11 15:45:37 GMT+1:00 1987
  1747. X/* LAST MODIFICATION
  1748. X/*    90/01/22 13:02:42
  1749. X/* VERSION/RELEASE
  1750. X/*    2.1
  1751. X/*--*/
  1752. END_OF_main/status.h
  1753. if test 1700 -ne `wc -c <main/status.h`; then
  1754.     echo shar: \"main/status.h\" unpacked with wrong size!
  1755. fi
  1756. # end of overwriting check
  1757. fi
  1758. if test -f main/submit.c -a "${1}" != "-c" ; then 
  1759.   echo shar: Will not over-write existing file \"main/submit.c\"
  1760. else
  1761. echo shar: Extracting \"main/submit.c\" \(1605 characters\)
  1762. sed "s/^X//" >main/submit.c <<'END_OF_main/submit.c'
  1763. X/*++
  1764. X/* NAME
  1765. X/*    submit 3
  1766. X/* SUMMARY
  1767. X/*    queue a message for transfer over the network
  1768. X/* PROJECT
  1769. X/*    pc-mail
  1770. X/* PACKAGE
  1771. X/*    mail
  1772. X/* SYNOPSIS
  1773. X/*    int submit(file,to)
  1774. X/*    char *file;
  1775. X/*    char *to;
  1776. X/* DESCRIPTION
  1777. X/*    submit() invokes the smail command to prepare a message for
  1778. X/*    transmission across the network. file is the name of a file
  1779. X/*    with a message; to is a string with one or more destinations,
  1780. X/*    separated by blanks. The to string is modified.
  1781. X/* FUNCTIONS AND MACROS
  1782. X/*    invokevp()
  1783. X/* COMMANDS
  1784. X/*    smail, alias processing and queueing
  1785. X/* FILES
  1786. X/*    d<seqno>    message file
  1787. X/*    x<seqno>    destination
  1788. X/* SEE ALSO
  1789. X/*    path(5)        spool file names
  1790. X/*    status(5)    error status codes
  1791. X/* DIAGNOSTICS
  1792. X/*    A nonzero error status is returned in case of problems.
  1793. X/* BUGS
  1794. X/*    On some non-Unix systems the limit on the command-line length
  1795. X/*    may cause problems.
  1796. X/* AUTHOR(S)
  1797. X/*    W.Z. Venema
  1798. X/*    Eindhoven University of Technology
  1799. X/*    Department of Mathematics and Computer Science
  1800. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  1801. X/* CREATION DATE
  1802. X/*    Sat Apr  9 17:48:03 MET 1988
  1803. X/* LAST MODIFICATION
  1804. X/*    90/01/22 13:02:44
  1805. X/* VERSION/RELEASE
  1806. X/*    2.1
  1807. X/*--*/
  1808. X
  1809. X#include <stdio.h>
  1810. X
  1811. X#include "defs.h"
  1812. X#include "path.h"
  1813. X
  1814. Xpublic int submit(file, to)
  1815. Xchar   *file;
  1816. Xchar   *to;
  1817. X{
  1818. X#ifdef    lint
  1819. X    static
  1820. X#endif
  1821. X    char   *arglist[BUFSIZ];
  1822. X    register char **cpp = arglist;
  1823. X    static char sep[] = ", \t";
  1824. X
  1825. X    /* Build the argment vector for the smail command */
  1826. X
  1827. X    *cpp++ = SMAIL;
  1828. X    *cpp++ = file;
  1829. X
  1830. X    for (*cpp = strtok(to, sep); *cpp; *++cpp = strtok((char *) 0, sep))
  1831. X     /* void */ ;
  1832. X
  1833. X    return (invokevp(arglist));
  1834. X}
  1835. END_OF_main/submit.c
  1836. if test 1605 -ne `wc -c <main/submit.c`; then
  1837.     echo shar: \"main/submit.c\" unpacked with wrong size!
  1838. fi
  1839. # end of overwriting check
  1840. fi
  1841. if test -f main/sysdep.h -a "${1}" != "-c" ; then 
  1842.   echo shar: Will not over-write existing file \"main/sysdep.h\"
  1843. else
  1844. echo shar: Extracting \"main/sysdep.h\" \(1096 characters\)
  1845. sed "s/^X//" >main/sysdep.h <<'END_OF_main/sysdep.h'
  1846. X/*++
  1847. X/* NAME
  1848. X/*    sysdep 5
  1849. X/* SUMMARY
  1850. X/*    system dependencies for comm. port i/o
  1851. X/* PROJECT
  1852. X/*    pc-mail
  1853. X/* PACKAGE
  1854. X/*    cico
  1855. X/* SYNOPSIS
  1856. X/*    #include "sysdep.h"
  1857. X/* DESCRIPTION
  1858. X/* .nf
  1859. X
  1860. X /* try to unite unix and dos */
  1861. X
  1862. X#ifdef    unix
  1863. X#define    xwrite    write
  1864. X#define    xread    read
  1865. Xextern int xopen(),xclose(),xgetc();
  1866. X#endif
  1867. X
  1868. X#ifdef MSDOS
  1869. X#include <fcntl.h>
  1870. X#include <signal.h>
  1871. X#include <dos.h>
  1872. X#include "comport.h"
  1873. X#include "clmap.h"
  1874. X
  1875. Xtypedef struct timetype {
  1876. X        unsigned hour;
  1877. X        unsigned minute;
  1878. X        unsigned sec;
  1879. X        unsigned hsec;
  1880. X} TIME, *TIME_PTR;
  1881. X
  1882. Xextern int xread(),xwrite(),xopen(),xclose(),xgetc();
  1883. X#endif
  1884. X
  1885. X/* time-out interval serial-port i/o */
  1886. X
  1887. X#define BYTE_TIMEOUT    20
  1888. X/* AUTHOR(S)
  1889. X/*    MS-DOS parts derived from uuslave sources (John Gilmore)
  1890. X/*    published on usenet early 1987.
  1891. X/*
  1892. X/*    W.Z. Venema
  1893. X/*    Eindhoven University of Technology
  1894. X/*    Department of Mathematics and Computer Science
  1895. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  1896. X/* CREATION DATE
  1897. X/*    Sun Apr 12 17:48:08 GMT+1:00 1987
  1898. X/* LAST MODIFICATION
  1899. X/*    90/01/22 13:02:47
  1900. X/* VERSION/RELEASE
  1901. X/*    2.1
  1902. X/*--*/
  1903. END_OF_main/sysdep.h
  1904. if test 1096 -ne `wc -c <main/sysdep.h`; then
  1905.     echo shar: \"main/sysdep.h\" unpacked with wrong size!
  1906. fi
  1907. # end of overwriting check
  1908. fi
  1909. if test -f main/textcopy.c -a "${1}" != "-c" ; then 
  1910.   echo shar: Will not over-write existing file \"main/textcopy.c\"
  1911. else
  1912. echo shar: Extracting \"main/textcopy.c\" \(1234 characters\)
  1913. sed "s/^X//" >main/textcopy.c <<'END_OF_main/textcopy.c'
  1914. X/*++
  1915. X/* NAME
  1916. X/*    textcopy 3
  1917. X/* SUMMARY
  1918. X/*    copy text to stream
  1919. X/* PROJECT
  1920. X/*    pc-mail
  1921. X/* PACKAGE
  1922. X/*    mail
  1923. X/* SYNOPSIS
  1924. X/*    int textcopy(path, fp)
  1925. X/*    char *path;
  1926. X/*    FILE *fp;
  1927. X/* DESCRIPTION
  1928. X/*      This function filters the contents of a file and writes the result
  1929. X/*    to a stdio stream. It can be used, for example, to provide optional
  1930. X/*    headers and trailers for new mail messages and for replies.
  1931. X/* SEE ALSO
  1932. X/*    ascf(3) text filter
  1933. X/* DIAGNOSTICS
  1934. X/*    A nonzero value is returned in case of problems.
  1935. X/* AUTHOR(S)
  1936. X/*      W.Z. Venema
  1937. X/*      Eindhoven University of Technology
  1938. X/*      Department of Mathematics and Computer Science
  1939. X/*      Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  1940. X/* CREATION DATE
  1941. X/*    Fri Dec 15 21:39:26 MET 1989
  1942. X/* LAST MODIFICATION
  1943. X/*    90/01/22 13:02:48
  1944. X/* VERSION/RELEASE
  1945. X/*    2.1
  1946. X/*--*/
  1947. X
  1948. X#include <stdio.h>
  1949. X
  1950. X#include "defs.h"
  1951. X#include "ascf.h"
  1952. X
  1953. X/* textcopy - copy text to stream */
  1954. X
  1955. Xpublic int textcopy(path, fp)
  1956. Xchar   *path;
  1957. XFILE   *fp;
  1958. X{
  1959. X    char    buf[BUFSIZ];
  1960. X    int     ret;
  1961. X    FILE   *ip;
  1962. X
  1963. X    if ((ip = ascopen(path, "r")) == 0) {
  1964. X    return (1);
  1965. X    } else {
  1966. X    while (ascgets(buf, sizeof(buf), ip))
  1967. X        fputs(buf, fp), putc('\n', fp);
  1968. X    ret = ferror(ip);
  1969. X    ascclose(ip);
  1970. X    return (ret);
  1971. X    }
  1972. X}
  1973. END_OF_main/textcopy.c
  1974. if test 1234 -ne `wc -c <main/textcopy.c`; then
  1975.     echo shar: \"main/textcopy.c\" unpacked with wrong size!
  1976. fi
  1977. # end of overwriting check
  1978. fi
  1979. if test -f main/work.h -a "${1}" != "-c" ; then 
  1980.   echo shar: Will not over-write existing file \"main/work.h\"
  1981. else
  1982. echo shar: Extracting \"main/work.h\" \(1094 characters\)
  1983. sed "s/^X//" >main/work.h <<'END_OF_main/work.h'
  1984. X/*++
  1985. X/* NAME
  1986. X/*      scanwork,rmtwork 5
  1987. X/* SUMMARY
  1988. X/*      spool directory access for cico
  1989. X/* PROJECT
  1990. X/*      pc-mail
  1991. X/* PACKAGE
  1992. X/*      cico
  1993. X/* SYNOPSIS
  1994. X/*    #include <stdio.h>
  1995. X/*      #include "work.h"
  1996. X/* DESCRIPTION
  1997. X/* .nf
  1998. X
  1999. X /* globally visible elements of scanwork.c */
  2000. X
  2001. Xtypedef struct {
  2002. X    char    type;            /* Data, eXecute */
  2003. X    char    path[BUFSIZ];        /* full path name (unsent file) */
  2004. X    char    sent[BUFSIZ];        /* full path name when sent */
  2005. X    unsigned seqno;            /* sequence number */
  2006. X    char    rqst[BUFSIZ];        /* uucp request message */
  2007. X    FILE   *fp;                /* associated file pointer */
  2008. X} work;
  2009. X
  2010. Xextern work *scanwork();        /* searches work files */
  2011. Xextern work *rmtwork();            /* assigns spool files */
  2012. Xextern void getwork();            /* receives remote work */
  2013. X
  2014. X/* AUTHOR(S)
  2015. X/*      W.Z. Venema
  2016. X/*      Eindhoven University of Technology
  2017. X/*      Department of Mathematics and Computer Science
  2018. X/*      Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  2019. X/* CREATION DATE
  2020. X/*    Sun Apr 12 14:30:28 GMT+1:00 1987
  2021. X/* LAST MODIFICATION
  2022. X/*    90/01/22 13:02:58
  2023. X/* VERSION/RELEASE
  2024. X/*    2.1
  2025. X/*--*/
  2026. END_OF_main/work.h
  2027. if test 1094 -ne `wc -c <main/work.h`; then
  2028.     echo shar: \"main/work.h\" unpacked with wrong size!
  2029. fi
  2030. # end of overwriting check
  2031. fi
  2032. if test ! -d termcap ; then
  2033.     echo shar: Creating directory \"termcap\"
  2034.     mkdir termcap
  2035. fi
  2036. if test -f termcap/README -a "${1}" != "-c" ; then 
  2037.   echo shar: Will not over-write existing file \"termcap/README\"
  2038. else
  2039. echo shar: Extracting \"termcap/README\" \(533 characters\)
  2040. sed "s/^X//" >termcap/README <<'END_OF_termcap/README'
  2041. X@(#) README 2.1 90/01/22 13:56:53
  2042. X
  2043. XMS-DOS Implementation notes, W.Z. Venema, Eindhoven University of Technology
  2044. X
  2045. XThe functions presented here implement UNIX-style terminal-independent
  2046. Xoperation routines for cursor addressing, video attributes etc.
  2047. X
  2048. XThe functions are effective for the ibm pc console, and assume that the 
  2049. XMS-DOS driver ANSI.SYS is loaded. The capabilities for the console are
  2050. Xstored in a static data structure.
  2051. X
  2052. XThe makefile is for Microsoft C; there is a batch file if your make
  2053. Xdoes not grok UNIX-style makefiles.
  2054. END_OF_termcap/README
  2055. if test 533 -ne `wc -c <termcap/README`; then
  2056.     echo shar: \"termcap/README\" unpacked with wrong size!
  2057. fi
  2058. # end of overwriting check
  2059. fi
  2060. if test -f termcap/buildall.bat -a "${1}" != "-c" ; then 
  2061.   echo shar: Will not over-write existing file \"termcap/buildall.bat\"
  2062. else
  2063. echo shar: Extracting \"termcap/buildall.bat\" \(253 characters\)
  2064. sed "s/^X//" >termcap/buildall.bat <<'END_OF_termcap/buildall.bat'
  2065. Xcl -Ml -c tgoto.c
  2066. Xcl -Ml -c tgetnum.c
  2067. Xcl -Ml -c tgetstr.c
  2068. Xcl -Ml -c tputs.c
  2069. Xcl -Ml -c tgetflag.c
  2070. Xcl -Ml -c tgetent.c
  2071. Xcl -Ml -c console.c
  2072. Xdel termcap.lib
  2073. Xlib termcap.lib tgoto.obj tgetnum.obj tgetstr.obj tputs.obj tgetflag.obj  tgetent.obj console.obj ;
  2074. END_OF_termcap/buildall.bat
  2075. if test 253 -ne `wc -c <termcap/buildall.bat`; then
  2076.     echo shar: \"termcap/buildall.bat\" unpacked with wrong size!
  2077. fi
  2078. # end of overwriting check
  2079. fi
  2080. if test -f termcap/makefile.msc -a "${1}" != "-c" ; then 
  2081.   echo shar: Will not over-write existing file \"termcap/makefile.msc\"
  2082. else
  2083. echo shar: Extracting \"termcap/makefile.msc\" \(497 characters\)
  2084. sed "s/^X//" >termcap/makefile.msc <<'END_OF_termcap/makefile.msc'
  2085. X# @(#) makefile.msc 2.1 90/01/22 13:57:00
  2086. X
  2087. XCFLAGS  = -Ml
  2088. XCC    = cl
  2089. X
  2090. XFILES    = README buildall.bat console.c makefile.msc termcap.h tgetent.c \
  2091. X    tgetflag.c tgetnum.c tgetstr.c tgoto.c tputs.c
  2092. X
  2093. XOBJECTS = tgoto.obj tgetnum.obj tgetstr.obj tputs.obj tgetflag.obj \
  2094. X    tgetent.obj console.obj
  2095. X
  2096. X.SUFFIXES: .obj
  2097. X
  2098. X.c.obj:
  2099. X    $(CC) $(CFLAGS) -c $*.c
  2100. X
  2101. Xtermcap.lib: $(OBJECTS)
  2102. X    del $@
  2103. X    lib $@ $(OBJECTS) ;
  2104. X
  2105. X$(OBJECTS): termcap.h
  2106. X
  2107. Xcleanup clean:
  2108. X    del $(OBJECTS)
  2109. X
  2110. Xclobber: clean
  2111. X    del termcap.lib
  2112. X
  2113. Xshar:
  2114. X    shar $(FILES)
  2115. END_OF_termcap/makefile.msc
  2116. if test 497 -ne `wc -c <termcap/makefile.msc`; then
  2117.     echo shar: \"termcap/makefile.msc\" unpacked with wrong size!
  2118. fi
  2119. # end of overwriting check
  2120. fi
  2121. if test -f termcap/termcap.h -a "${1}" != "-c" ; then 
  2122.   echo shar: Will not over-write existing file \"termcap/termcap.h\"
  2123. else
  2124. echo shar: Extracting \"termcap/termcap.h\" \(1066 characters\)
  2125. sed "s/^X//" >termcap/termcap.h <<'END_OF_termcap/termcap.h'
  2126. X/*++
  2127. X/* NAME
  2128. X/*    termcap.h 5
  2129. X/* SUMMARY
  2130. X/*    internal type declarations for termcap functions
  2131. X/* PROJECT
  2132. X/*    ms-dos/unix compatibility
  2133. X/* PACKAGE
  2134. X/*    termcap
  2135. X/* SYNOPSIS
  2136. X/*    #include "termcap.h"
  2137. X/* DESCRIPTION
  2138. X/*    termcap.h contains declarations for internal use of the MS-DOS 
  2139. X/*    implementation of the termcap(3) functions, assuming the
  2140. X/*    presence of the ANSI.SYS console driver.
  2141. X/* .nf
  2142. X
  2143. X /* function types */
  2144. X
  2145. Xextern tgetent();
  2146. Xextern tgetnum();
  2147. Xextern tgetflag();
  2148. Xextern char *tgetstr();
  2149. Xextern char *tgoto();
  2150. Xextern tputs();
  2151. X
  2152. X /* static storage for pc console capabilities */
  2153. X
  2154. Xtypedef struct {
  2155. X    char *name;
  2156. X    char *cap;
  2157. X} Cap;
  2158. X
  2159. Xextern Cap _console[];
  2160. X/* SEE ALSO
  2161. X/*    termcap(3), Berkeley extensions to UNIX.
  2162. X/* FILES
  2163. X/*    ANSI.SYS, ibm pc console driver.
  2164. X/* AUTHOR(S)
  2165. X/*    W.Z. Venema
  2166. X/*    Eindhoven University of Technology
  2167. X/*    Department of Mathematics and Computer Science
  2168. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  2169. X/* CREATION DATE
  2170. X/*    Wed Jan  1 19:01:13 GMT+1:00 1986
  2171. X/* LAST MODIFICATION
  2172. X/*    90/01/22 13:57:02
  2173. X/* VERSION/RELEASE
  2174. X/*    2.1
  2175. X/*--*/
  2176. END_OF_termcap/termcap.h
  2177. if test 1066 -ne `wc -c <termcap/termcap.h`; then
  2178.     echo shar: \"termcap/termcap.h\" unpacked with wrong size!
  2179. fi
  2180. # end of overwriting check
  2181. fi
  2182. if test -f termcap/tgetent.c -a "${1}" != "-c" ; then 
  2183.   echo shar: Will not over-write existing file \"termcap/tgetent.c\"
  2184. else
  2185. echo shar: Extracting \"termcap/tgetent.c\" \(1228 characters\)
  2186. sed "s/^X//" >termcap/tgetent.c <<'END_OF_termcap/tgetent.c'
  2187. X/*++
  2188. X/* NAME
  2189. X/*    tgetent 3
  2190. X/* SUMMARY
  2191. X/*    extract terminal entry from capability database
  2192. X/* PROJECT
  2193. X/*    ms-dos/unix compatibility
  2194. X/* PACKAGE
  2195. X/*    termcap
  2196. X/* SYNOPSIS
  2197. X/*    tgetent(bp,name)
  2198. X/*    char *bp,*name;
  2199. X/* DESCRIPTION
  2200. X/*    tgetent simulates its UNIX counterpart.
  2201. X/*    Its purpose is to extract from the capability database all
  2202. X/*    information for a specific terminal.
  2203. X/*
  2204. X/*    name should point to a string with the terminal name (usually
  2205. X/*    taken from the environment with getenv(3)).
  2206. X/*    bp should point to a 1024-character buffer for storage of
  2207. X/*    terminal information extracted from the capability database.
  2208. X/*
  2209. X/*    Since the capabilities of the ms-dos console are described by a
  2210. X/*    static data structure, tgetent(3) is a dummy function.
  2211. X/* SEE ALSO
  2212. X/*    termcap(3), Berkeley extensions to UNIX.
  2213. X/* FILES
  2214. X/*    ANSI.SYS, ibm pc console driver.
  2215. X/* AUTHOR(S)
  2216. X/*    W.Z. Venema
  2217. X/*    Eindhoven University of Technology
  2218. X/*    Department of Mathematics and Computer Science
  2219. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  2220. X/* CREATION DATE
  2221. X/*    Wed Jan  1 19:01:13 GMT+1:00 1986
  2222. X/* LAST MODIFICATION
  2223. X/*    90/01/22 13:57:04
  2224. X/* VERSION/RELEASE
  2225. X/*    2.1
  2226. X/*--*/
  2227. X
  2228. X#include "termcap.h"
  2229. X
  2230. Xtgetent(bp, name)
  2231. Xchar   *bp,
  2232. X       *name;
  2233. X{
  2234. X    return (1);
  2235. X}
  2236. END_OF_termcap/tgetent.c
  2237. if test 1228 -ne `wc -c <termcap/tgetent.c`; then
  2238.     echo shar: \"termcap/tgetent.c\" unpacked with wrong size!
  2239. fi
  2240. # end of overwriting check
  2241. fi
  2242. if test -f termcap/tgetflag.c -a "${1}" != "-c" ; then 
  2243.   echo shar: Will not over-write existing file \"termcap/tgetflag.c\"
  2244. else
  2245. echo shar: Extracting \"termcap/tgetflag.c\" \(1005 characters\)
  2246. sed "s/^X//" >termcap/tgetflag.c <<'END_OF_termcap/tgetflag.c'
  2247. X/*++
  2248. X/* NAME
  2249. X/*    tgetflag 3
  2250. X/* SUMMARY
  2251. X/*    check for existence of capability
  2252. X/* PROJECT
  2253. X/*    ms-dos/unix compatibility
  2254. X/* PACKAGE
  2255. X/*    termcap
  2256. X/* SYNOPSIS
  2257. X/*    tgetflag(name)
  2258. X/*    char *name;
  2259. X/* DESCRIPTION
  2260. X/*    tgetflag is a predicate function that evaluates to "true" when
  2261. X/*    the capablity in "name" is present in the terminal info extracted 
  2262. X/*    earlier with tgetent(3).
  2263. X/* SEE ALSO
  2264. X/*    tgetent(3), extracts terminal info from database.
  2265. X/*    termcap(3), Berkeley extensions to UNIX.
  2266. X/* FILES
  2267. X/*    ANSI.SYS, ibm pc console driver.
  2268. X/* AUTHOR(S)
  2269. X/*    W.Z. Venema
  2270. X/*    Eindhoven University of Technology
  2271. X/*    Department of Mathematics and Computer Science
  2272. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  2273. X/* CREATION DATE
  2274. X/*    Wed Jan  1 19:01:13 GMT+1:00 1986
  2275. X/* LAST MODIFICATION
  2276. X/*    90/01/22 13:57:09
  2277. X/* VERSION/RELEASE
  2278. X/*    2.1
  2279. X/*--*/
  2280. X
  2281. X#include "termcap.h"
  2282. X
  2283. Xtgetflag(id)
  2284. Xregister char *id;
  2285. X{
  2286. X    register Cap *p;
  2287. X
  2288. X    for (p = _console; *p->name; p++)
  2289. X    if (strcmp(id, p->name) == 0)
  2290. X        return 1;
  2291. X    return 0;
  2292. X}
  2293. END_OF_termcap/tgetflag.c
  2294. if test 1005 -ne `wc -c <termcap/tgetflag.c`; then
  2295.     echo shar: \"termcap/tgetflag.c\" unpacked with wrong size!
  2296. fi
  2297. # end of overwriting check
  2298. fi
  2299. if test -f termcap/tgetnum.c -a "${1}" != "-c" ; then 
  2300.   echo shar: Will not over-write existing file \"termcap/tgetnum.c\"
  2301. else
  2302. echo shar: Extracting \"termcap/tgetnum.c\" \(1024 characters\)
  2303. sed "s/^X//" >termcap/tgetnum.c <<'END_OF_termcap/tgetnum.c'
  2304. X/*++
  2305. X/* NAME
  2306. X/*    tgetnum 3
  2307. X/* SUMMARY
  2308. X/*    extract numerical capability from terminal database
  2309. X/* PROJECT
  2310. X/*    ms-dos/unix compatibility
  2311. X/* PACKAGE
  2312. X/*    termcap
  2313. X/* SYNOPSIS
  2314. X/*    tgetnum(name)
  2315. X/*    char *name;
  2316. X/* DESCRIPTION
  2317. X/*    tgetnum extracts the numerical value associated with the
  2318. X/*    capability in "name", for the terminal info extracted with
  2319. X/*    a previous call of tgetent(3).
  2320. X/* SEE ALSO
  2321. X/*    tgetent(3), extract terminal entry from database.
  2322. X/*    termcap(3), Berkeley extensions to UNIX.
  2323. X/* FILES
  2324. X/*    ANSI.SYS, ibm pc console driver.
  2325. X/* AUTHOR(S)
  2326. X/*    W.Z. Venema
  2327. X/*    Eindhoven University of Technology
  2328. X/*    Department of Mathematics and Computer Science
  2329. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  2330. X/* CREATION DATE
  2331. X/*    Wed Jan  1 19:01:13 GMT+1:00 1986
  2332. X/* LAST MODIFICATION
  2333. X/*    90/01/22 13:57:11
  2334. X/* VERSION/RELEASE
  2335. X/*    2.1
  2336. X/*--*/
  2337. X
  2338. X#include "termcap.h"
  2339. X
  2340. Xtgetnum(id)
  2341. Xregister char *id;
  2342. X{
  2343. X    register Cap *p;
  2344. X
  2345. X    for (p = _console; *p->name; p++)
  2346. X    if (strcmp(id, p->name) == 0)
  2347. X        return atoi(p->cap);
  2348. X    return -1;
  2349. X}
  2350. END_OF_termcap/tgetnum.c
  2351. if test 1024 -ne `wc -c <termcap/tgetnum.c`; then
  2352.     echo shar: \"termcap/tgetnum.c\" unpacked with wrong size!
  2353. fi
  2354. # end of overwriting check
  2355. fi
  2356. if test -f termcap/tgetstr.c -a "${1}" != "-c" ; then 
  2357.   echo shar: Will not over-write existing file \"termcap/tgetstr.c\"
  2358. else
  2359. echo shar: Extracting \"termcap/tgetstr.c\" \(1307 characters\)
  2360. sed "s/^X//" >termcap/tgetstr.c <<'END_OF_termcap/tgetstr.c'
  2361. X/*++
  2362. X/* NAME
  2363. X/*    tgetstr 3
  2364. X/* SUMMARY
  2365. X/*    extract string-valued capability from terminal database
  2366. X/* PROJECT
  2367. X/*    ms-dos/unix compatibility
  2368. X/* PACKAGE
  2369. X/*    termcap
  2370. X/* SYNOPSIS
  2371. X/*    char *tgetstr(name,area)
  2372. X/*    char *name,**area;
  2373. X/* DESCRIPTION
  2374. X/*    tgetstr extracts the string value associated with the capability
  2375. X/*    in "name", from the info obtained earlier through a call of
  2376. X/*    tgetent(3). area is a pointer to a 1024-character buffer and is
  2377. X/*    updated with each call of tgetstr(3).
  2378. X/*
  2379. X/*    Since the capabilities of the ms-dos console are stored in a static
  2380. X/*    data structure,
  2381. X/*    the area pointer is not used in the MS-DOS implementation.
  2382. X/* SEE ALSO
  2383. X/*    tgetent(3), extract terminal entry from database.
  2384. X/*    termcap(3), Berkeley extensions to UNIX.
  2385. X/* FILES
  2386. X/*    ANSI.SYS, ibm pc console driver.
  2387. X/* AUTHOR(S)
  2388. X/*    W.Z. Venema
  2389. X/*    Eindhoven University of Technology
  2390. X/*    Department of Mathematics and Computer Science
  2391. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  2392. X/* CREATION DATE
  2393. X/*    Wed Jan  1 19:01:13 GMT+1:00 1986
  2394. X/* LAST MODIFICATION
  2395. X/*    90/01/22 13:57:13
  2396. X/* VERSION/RELEASE
  2397. X/*    2.1
  2398. X/*--*/
  2399. X
  2400. X#include "termcap.h"
  2401. X
  2402. Xchar   *tgetstr(id, area)
  2403. Xregister char *id;
  2404. Xchar  **area;
  2405. X{
  2406. X    register Cap *p;
  2407. X
  2408. X    for (p = _console; *p->name; p++)
  2409. X    if (strcmp(id, p->name) == 0)
  2410. X        return (p->cap);
  2411. X    return 0;
  2412. X}
  2413. END_OF_termcap/tgetstr.c
  2414. if test 1307 -ne `wc -c <termcap/tgetstr.c`; then
  2415.     echo shar: \"termcap/tgetstr.c\" unpacked with wrong size!
  2416. fi
  2417. # end of overwriting check
  2418. fi
  2419. if test -f termcap/tgoto.c -a "${1}" != "-c" ; then 
  2420.   echo shar: Will not over-write existing file \"termcap/tgoto.c\"
  2421. else
  2422. echo shar: Extracting \"termcap/tgoto.c\" \(1376 characters\)
  2423. sed "s/^X//" >termcap/tgoto.c <<'END_OF_termcap/tgoto.c'
  2424. X/*++
  2425. X/* NAME
  2426. X/*      tgoto 3
  2427. X/* SUMMARY
  2428. X/*      absolute cursor addressing
  2429. X/* PROJECT
  2430. X/*      ms-dos/unix compatibility
  2431. X/* PACKAGE
  2432. X/*      termcap
  2433. X/* SYNOPSIS
  2434. X/*      char *tgoto(cm,destcol,destline)
  2435. X/*      char *cm;
  2436. X/*      int destcol,destline;
  2437. X/* DESCRIPTION
  2438. X/*      tgoto(3) returns a character string for absolute cursor addressing.
  2439. X/*      Usually, the string is constructed on the basis of the "cm" capability
  2440. X/*      extracted from the terminal capability database.
  2441. X/*
  2442. X/*      In the ms-dos implementation cursor addressing is hardwired into
  2443. X/*      the tgoto(3) algorithm.
  2444. X/* SEE ALSO
  2445. X/*      tgetstr(3)      Extracts string capability from data base
  2446. X/*      termcap(3)      Berkeley extensions to UNIX.
  2447. X/* FILES
  2448. X/*      ANSI.SYS, ibm pc console driver.
  2449. X/* AUTHOR(S)
  2450. X/*      W.Z. Venema
  2451. X/*      Eindhoven University of Technology
  2452. X/*      Department of Mathematics and Computer Science
  2453. X/*      Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  2454. X/* CREATION DATE
  2455. X/*      Wed Jan  1 19:01:13 GMT+1:00 1986
  2456. X/* LAST MODIFICATION
  2457. X/*      90/01/22 13:57:19
  2458. X/* VERSION/RELEASE
  2459. X/*      2.1
  2460. X/*--*/
  2461. X
  2462. X#include "termcap.h"
  2463. X
  2464. X/* version with wired-in cursor movement */
  2465. X
  2466. Xchar   *tgoto(cm, destcol, destline)
  2467. Xchar   *cm;
  2468. Xint     destcol;
  2469. Xint     destline;
  2470. X{
  2471. X    static char buf[100];
  2472. X
  2473. X    (void) sprintf(buf, "\033[%d;%dH", destline + 1, destcol + 1);
  2474. X    return buf;
  2475. X}
  2476. END_OF_termcap/tgoto.c
  2477. if test 1376 -ne `wc -c <termcap/tgoto.c`; then
  2478.     echo shar: \"termcap/tgoto.c\" unpacked with wrong size!
  2479. fi
  2480. # end of overwriting check
  2481. fi
  2482. if test -f termcap/tputs.c -a "${1}" != "-c" ; then 
  2483.   echo shar: Will not over-write existing file \"termcap/tputs.c\"
  2484. else
  2485. echo shar: Extracting \"termcap/tputs.c\" \(1036 characters\)
  2486. sed "s/^X//" >termcap/tputs.c <<'END_OF_termcap/tputs.c'
  2487. X/*++
  2488. X/* NAME
  2489. X/*    tputs 3
  2490. X/* SUMMARY
  2491. X/*    output string with padding
  2492. X/* PROJECT
  2493. X/*    ms-dos/unix compatibility
  2494. X/* PACKAGE
  2495. X/*    termcap
  2496. X/* SYNOPSIS
  2497. X/*    tputs(cp,affcnt,outc)
  2498. X/*    char *p;
  2499. X/*    int affcnt;
  2500. X/*    int (*outc)();
  2501. X/* DESCRIPTION
  2502. X/*    tputs interprets leading padding information in the string
  2503. X/*    pointed to by cp, and outputs through the function pointed
  2504. X/*    to by outc.
  2505. X/*
  2506. X/*    In the MS-DOS implementation, padding information is not
  2507. X/*    needed.
  2508. X/* SEE ALSO
  2509. X/*    termcap(3), Berkeley extensions to UNIX.
  2510. X/* FILES
  2511. X/*    ANSI.SYS, ibm pc console driver.
  2512. X/* AUTHOR(S)
  2513. X/*    W.Z. Venema
  2514. X/*    Eindhoven University of Technology
  2515. X/*    Department of Mathematics and Computer Science
  2516. X/*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  2517. X/* CREATION DATE
  2518. X/*    Wed Jan  1 19:01:13 GMT+1:00 1986
  2519. X/* LAST MODIFICATION
  2520. X/*    90/01/22 13:57:21
  2521. X/* VERSION/RELEASE
  2522. X/*    2.1
  2523. X/*--*/
  2524. X
  2525. X#include "termcap.h"
  2526. X
  2527. X/* version does not check for padding */
  2528. X
  2529. Xtputs(cp, affcnt, outc)
  2530. Xregister char *cp;
  2531. Xint     affcnt;
  2532. Xregister int (*outc) ();
  2533. X{
  2534. X    while (*cp)
  2535. X    (*outc) (*cp++);
  2536. X}
  2537. END_OF_termcap/tputs.c
  2538. if test 1036 -ne `wc -c <termcap/tputs.c`; then
  2539.     echo shar: \"termcap/tputs.c\" unpacked with wrong size!
  2540. fi
  2541. # end of overwriting check
  2542. fi
  2543. echo shar: End of archive 1 \(of 11\).
  2544. cp /dev/null ark1isdone
  2545. MISSING=""
  2546. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  2547.     if test ! -f ark${I}isdone ; then
  2548.     MISSING="${MISSING} ${I}"
  2549.     fi
  2550. done
  2551. if test "${MISSING}" = "" ; then
  2552.     echo You have unpacked all 11 archives.
  2553.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2554. else
  2555.     echo You still need to unpack the following archives:
  2556.     echo "        " ${MISSING}
  2557. fi
  2558. ##  End of shell archive.
  2559. exit 0
  2560.  
  2561.